autologin fix

This commit is contained in:
Martti Malmi 2023-02-08 12:14:11 +02:00
parent 809f1d9633
commit b71f38ce17
3 changed files with 4 additions and 8 deletions

View File

@ -1,8 +1,7 @@
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
import { createHashHistory } from 'history';
import iris from 'iris-lib'; import iris from 'iris-lib';
import AsyncRoute from 'preact-async-route'; import AsyncRoute from 'preact-async-route';
import { CustomHistory, Router, RouterOnChangeArgs } from 'preact-router'; import { Router, RouterOnChangeArgs } from 'preact-router';
import '@fontsource/lato'; import '@fontsource/lato';
@ -47,7 +46,7 @@ type ReactState = {
}; };
// need to add initChannels: true to here and login() to get channels to load. disabled to test performance // need to add initChannels: true to here and login() to get channels to load. disabled to test performance
iris.session.init({ autologin: window.location.hash.length > 2, autofollow: false }); iris.session.init({ autologin: window.location.href.length > 1, autofollow: false });
Nostr.init(); Nostr.init();
class Main extends Component<Props, ReactState> { class Main extends Component<Props, ReactState> {

View File

@ -78,10 +78,7 @@ class Footer extends Component<Props, State> {
<a href="/global" class={`btn ${activeRoute === '/global' ? 'active' : ''}`}> <a href="/global" class={`btn ${activeRoute === '/global' ? 'active' : ''}`}>
{Icons.global} {Icons.global}
</a> </a>
<a <a href={`/${key}`} class={`${activeRoute === `/${key}` ? 'active' : ''} my-profile`}>
href={`/${key}`}
class={`${activeRoute === `/${key}` ? 'active' : ''} my-profile`}
>
<Identicon str={key} width={34} /> <Identicon str={key} width={34} />
</a> </a>
</div> </div>

View File

@ -216,7 +216,7 @@ class Login extends Component {
<div id="existing-account-login"> <div id="existing-account-login">
<p> <p>
<a href="#" id="show-create-account" onClick={(e) => this.showCreateAccount(e)}> <a href="#" id="show-create-account" onClick={(e) => this.showCreateAccount(e)}>
{t('back')} {t('back')}
</a> </a>
</p> </p>
{this.renderExistingAccountLogin()} {this.renderExistingAccountLogin()}