all routes start on the loading page

This commit is contained in:
Miodec 2022-01-20 00:34:50 +01:00
parent 44b809d3c1
commit 9fd96201a7
3 changed files with 21 additions and 16 deletions

View file

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

View file

@ -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 = [];

View file

@ -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",
};