From 90e3ad4957cb183914087a033bd78d698f2b2a01 Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 9 Aug 2024 10:45:57 +0200 Subject: [PATCH] refactor: move psa check to after auth was initialised --- frontend/src/ts/controllers/account-controller.ts | 2 ++ frontend/src/ts/ready.ts | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/ts/controllers/account-controller.ts b/frontend/src/ts/controllers/account-controller.ts index d9a74680b..555b99bcd 100644 --- a/frontend/src/ts/controllers/account-controller.ts +++ b/frontend/src/ts/controllers/account-controller.ts @@ -46,6 +46,7 @@ import * as ConnectionState from "../states/connection"; import { navigate } from "./route-controller"; import { getHtmlByUserFlags } from "./user-flag-controller"; import { FirebaseError } from "firebase/app"; +import * as PSA from "../elements/psa"; export const gmailProvider = new GoogleAuthProvider(); export const githubProvider = new GithubAuthProvider(); @@ -226,6 +227,7 @@ async function readyFunction( const hash = window.location.hash; console.debug(`account controller ready`); if (authInitialisedAndConnected) { + void PSA.show(); console.debug(`auth state changed, user ${user ? true : false}`); console.debug(user); if (user) { diff --git a/frontend/src/ts/ready.ts b/frontend/src/ts/ready.ts index e373d44dc..8af4be4e0 100644 --- a/frontend/src/ts/ready.ts +++ b/frontend/src/ts/ready.ts @@ -3,7 +3,6 @@ import * as Misc from "./utils/misc"; import * as MonkeyPower from "./elements/monkey-power"; import * as Notifications from "./elements/notifications"; import * as CookiesModal from "./modals/cookies"; -import * as PSA from "./elements/psa"; import * as ConnectionState from "./states/connection"; import * as FunboxList from "./test/funbox/funbox-list"; //@ts-expect-error @@ -46,7 +45,6 @@ $((): void => { .stop(true, true) .animate({ opacity: 1 }, 250); if (ConnectionState.get()) { - void PSA.show(); void ServerConfiguration.sync().then(() => { if (!ServerConfiguration.get()?.users.signUp) { $(".signInOut").addClass("hidden");