Fixed circular dependency (#2471)

This commit is contained in:
Rizwan Mustafa 2022-02-11 22:36:20 +05:00 committed by GitHub
parent 075000d554
commit fe5d9de742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 10 deletions

View file

@ -44,7 +44,10 @@ async function loadUser(user) {
PageTransition.set(false);
AccountButton.update();
AccountButton.loading(true);
await Account.getDataAndInit();
if ((await Account.getDataAndInit()) == false) {
console.log("Signing out!");
signOut();
}
// var displayName = user.displayName;
// var email = user.email;
// var emailVerified = user.emailVerified;
@ -564,3 +567,7 @@ $(".pageSettings #addGoogleAuth").on("click", async (e) => {
$(".pageSettings #removeGoogleAuth").on("click", (e) => {
removeGoogleAuth();
});
$(document).on("click", ".pageAccount .sendVerificationEmail", (event) => {
sendVerificationEmail();
});

View file

@ -10,6 +10,7 @@ Chart.plugins.register(chartAnnotation);
import * as DB from "./db";
import * as Misc from "./misc";
import "./controllers/account-controller";
import Config from "./config";
import { enable } from "./states/glarses-mode";
import "./test/caps-warning";

View file

@ -16,7 +16,6 @@ import * as ResultTagsPopup from "../popups/result-tags-popup";
import * as Settings from "./settings";
import * as AllTimeStats from "../account/all-time-stats";
import * as PbTables from "../account/pb-tables";
import * as AccountController from "../controllers/account-controller";
import * as LoadingPage from "./loading";
import * as Focus from "../test/focus";
import * as SignOutButton from "../account/sign-out-button";
@ -67,8 +66,7 @@ export async function getDataAndInit() {
// $("#top #menu .account .icon").html('<i class="fas fa-fw fa-times"></i>');
$("#top #menu .account").css("opacity", 1);
if (ActivePage.get() == "loading") PageController.change("");
AccountController.signOut();
return;
return false;
}
if (ActivePage.get() == "loading") {
LoadingPage.updateBar(100);
@ -139,8 +137,7 @@ export async function getDataAndInit() {
);
if (name == null) {
AccountController.signOut();
return;
return false;
}
let response;
@ -1200,10 +1197,6 @@ $(document).on("click", ".pageAccount .miniResultChartButton", (event) => {
);
});
$(document).on("click", ".pageAccount .sendVerificationEmail", (event) => {
AccountController.sendVerificationEmail();
});
$(document).on("click", ".history-wpm-header", (event) => {
sortAndRefreshHistory("wpm", ".history-wpm-header");
});