mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 06:03:22 +00:00
move session init before main render
This commit is contained in:
parent
4ad1323ab8
commit
aec5728669
@ -6,7 +6,6 @@ import Footer from './components/Footer';
|
||||
import Show from './components/helpers/Show';
|
||||
import Menu from './components/Menu';
|
||||
import Modal from './components/modal/Modal';
|
||||
import Session from './nostr/Session';
|
||||
import { translationLoaded } from './translations/Translation.mjs';
|
||||
import Helpers from './utils/Helpers';
|
||||
import About from './views/About';
|
||||
@ -44,8 +43,6 @@ type ReactState = {
|
||||
showLoginModal: boolean;
|
||||
};
|
||||
|
||||
Session.init({ autologin: false, autofollow: false });
|
||||
|
||||
class Main extends Component<Props, ReactState> {
|
||||
componentDidMount() {
|
||||
window.onload = () => {
|
||||
@ -158,6 +155,4 @@ class Main extends Component<Props, ReactState> {
|
||||
}
|
||||
}
|
||||
|
||||
Helpers.showConsoleWarning();
|
||||
|
||||
export default Main;
|
||||
|
@ -13,6 +13,7 @@ import { Path } from './path';
|
||||
import PubSub from './PubSub';
|
||||
import Relays from './Relays';
|
||||
import SocialNetwork from './SocialNetwork';
|
||||
import Helpers from "@/utils/Helpers.tsx";
|
||||
|
||||
try {
|
||||
localStorage.setItem('gunPeers', JSON.stringify({})); // quick fix to not connect gun
|
||||
@ -148,6 +149,7 @@ const Session = {
|
||||
init: function (options: any) {
|
||||
Key.getOrCreate(options);
|
||||
localState.get('loggedIn').on(() => this.onLoggedIn());
|
||||
Helpers.showConsoleWarning();
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,11 @@
|
||||
import { render } from 'preact';
|
||||
|
||||
import Session from '@/nostr/Session';
|
||||
|
||||
import Main from './js/Main';
|
||||
|
||||
import './index.css';
|
||||
|
||||
Session.init({ autologin: false, autofollow: false });
|
||||
|
||||
render(<Main />, document.getElementById('app') as HTMLElement);
|
||||
|
Loading…
Reference in New Issue
Block a user