diff --git a/src/js/Main.tsx b/src/js/Main.tsx index b2823ac9..91459763 100644 --- a/src/js/Main.tsx +++ b/src/js/Main.tsx @@ -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 { componentDidMount() { window.onload = () => { @@ -158,6 +155,4 @@ class Main extends Component { } } -Helpers.showConsoleWarning(); - export default Main; diff --git a/src/js/nostr/Session.ts b/src/js/nostr/Session.ts index 249c7f41..e5900319 100644 --- a/src/js/nostr/Session.ts +++ b/src/js/nostr/Session.ts @@ -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(); }, }; diff --git a/src/main.tsx b/src/main.tsx index 41b1ae48..6b8b6eaf 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -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(
, document.getElementById('app') as HTMLElement);