mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 07:46:15 +08:00
all routes start on the loading page
This commit is contained in:
parent
44b809d3c1
commit
9fd96201a7
|
@ -65,9 +65,13 @@ const authListener = firebase.auth().onAuthStateChanged(async function (user) {
|
|||
await loadUser(user);
|
||||
} else {
|
||||
UI.setPageTransition(false);
|
||||
Focus.set(false);
|
||||
if (UI.getActivePage() == "pageLoading") UI.changePage("");
|
||||
}
|
||||
if (window.location.pathname != "/account") {
|
||||
setTimeout(() => {
|
||||
Focus.set(false);
|
||||
}, 125 / 2);
|
||||
}
|
||||
UI.changePage();
|
||||
let theme = Misc.findGetParameter("customTheme");
|
||||
if (theme !== null) {
|
||||
try {
|
||||
|
@ -119,6 +123,7 @@ export function signIn() {
|
|||
.signInWithEmailAndPassword(email, password)
|
||||
.then(async (e) => {
|
||||
await loadUser(e.user);
|
||||
UI.changePage("account");
|
||||
if (TestLogic.notSignedInLastResult !== null) {
|
||||
TestLogic.setNotSignedInUid(e.user.uid);
|
||||
let response;
|
||||
|
|
|
@ -208,12 +208,12 @@ export async function getDataAndInit() {
|
|||
PaceCaret.init(true);
|
||||
}
|
||||
}
|
||||
if (
|
||||
UI.getActivePage() == "pageLogin" ||
|
||||
window.location.pathname === "/account"
|
||||
) {
|
||||
UI.changePage("account");
|
||||
}
|
||||
// if (
|
||||
// UI.getActivePage() == "pageLogin" ||
|
||||
// window.location.pathname === "/account"
|
||||
// ) {
|
||||
// UI.changePage("account");
|
||||
// }
|
||||
ThemePicker.refreshButtons();
|
||||
AccountButton.loading(false);
|
||||
ResultFilters.updateTags();
|
||||
|
@ -223,11 +223,11 @@ export async function getDataAndInit() {
|
|||
Settings.showAccountSection();
|
||||
UI.setPageTransition(false);
|
||||
console.log("account loading finished");
|
||||
if (UI.getActivePage() == "pageLoading") {
|
||||
LoadingPage.updateBar(100, true);
|
||||
Focus.set(false);
|
||||
UI.changePage("");
|
||||
}
|
||||
// if (UI.getActivePage() == "pageLoading") {
|
||||
// LoadingPage.updateBar(100, true);
|
||||
// Focus.set(false);
|
||||
// UI.changePage("");
|
||||
// }
|
||||
}
|
||||
|
||||
let filteredResults = [];
|
||||
|
|
|
@ -4,9 +4,9 @@ import Config from "./config";
|
|||
|
||||
let mappedRoutes = {
|
||||
"/": "pageLoading",
|
||||
"/login": "pageLogin",
|
||||
"/settings": "pageSettings",
|
||||
"/about": "pageAbout",
|
||||
"/login": "pageLoading",
|
||||
"/settings": "pageLoading",
|
||||
"/about": "pageLoading",
|
||||
"/account": "pageAccount",
|
||||
"/verify": "pageLoading",
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue