fix login page showing when logged in

This commit is contained in:
ari melody 2024-06-29 15:52:52 +01:00
parent 8f41613179
commit ce1dfc388f
Signed by: ari
GPG key ID: CF99829C92678188
3 changed files with 53 additions and 45 deletions

View file

@ -15,6 +15,7 @@ export class Client {
constructor() {
this.instance = null;
this.app = null;
this.user = null;
this.cache = {
users: {},
emojis: {},
@ -86,10 +87,13 @@ export class Client {
async verifyCredentials() {
const data = await api.verifyCredentials();
if (!data) return false;
if (!data) {
this.user = false;
return false;
}
this.user = await api.parseUser(data);
client.set(this);
return data;
return this.user;
}
async getTimeline(last_post_id) {