refactor: move psa check to after auth was initialised

This commit is contained in:
Miodec 2024-08-09 10:45:57 +02:00
parent 690dee1257
commit 90e3ad4957
2 changed files with 2 additions and 2 deletions

View file

@ -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) {

View file

@ -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");