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 { createHashHistory } from 'history';
import iris from 'iris-lib';
import AsyncRoute from 'preact-async-route';
import { CustomHistory, Router, RouterOnChangeArgs } from 'preact-router';
import { Router, RouterOnChangeArgs } from 'preact-router';
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
iris.session.init({ autologin: window.location.hash.length > 2, autofollow: false });
iris.session.init({ autologin: window.location.href.length > 1, autofollow: false });
Nostr.init();
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' : ''}`}>
{Icons.global}
</a>
<a
href={`/${key}`}
class={`${activeRoute === `/${key}` ? 'active' : ''} my-profile`}
>
<a href={`/${key}`} class={`${activeRoute === `/${key}` ? 'active' : ''} my-profile`}>
<Identicon str={key} width={34} />
</a>
</div>

View File

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