mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-23 10:01:58 +08:00
not loading settings page if not needed
removing hidden elements when not needed
This commit is contained in:
parent
923d076032
commit
2465fc388c
4 changed files with 20 additions and 5 deletions
|
|
@ -214,7 +214,7 @@ export async function getDataAndInit() {
|
|||
// ) {
|
||||
// UI.changePage("account");
|
||||
// }
|
||||
ThemePicker.refreshButtons();
|
||||
// ThemePicker.refreshButtons();
|
||||
AccountButton.loading(false);
|
||||
ResultFilters.updateTags();
|
||||
CommandlineLists.updateTagCommands();
|
||||
|
|
|
|||
|
|
@ -72,6 +72,6 @@ $(document).ready(() => {
|
|||
// UI.changePage(page);
|
||||
}
|
||||
});
|
||||
Settings.settingsFillPromise.then(Settings.update);
|
||||
// Settings.settingsFillPromise.then(Settings.update);
|
||||
MonkeyPower.init();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -276,7 +276,17 @@ async function initGroups() {
|
|||
// );
|
||||
}
|
||||
|
||||
async function fillSettingsPage() {
|
||||
export function reset() {
|
||||
$(".pageSettings .section.themes .favThemes.buttons").empty();
|
||||
$(".pageSettings .section.themes .allThemes.buttons").empty();
|
||||
$(".pageSettings .section.languageGroups .buttons").empty();
|
||||
$(".pageSettings .section.layout .buttons").empty();
|
||||
$(".pageSettings .section.keymapLayout .buttons").empty();
|
||||
$(".pageSettings .section.funbox .buttons").empty();
|
||||
$(".pageSettings .section.fontFamily .buttons").empty();
|
||||
}
|
||||
|
||||
export async function fillSettingsPage() {
|
||||
await initGroups();
|
||||
await UpdateConfig.loadPromise;
|
||||
ThemePicker.refreshButtons();
|
||||
|
|
@ -385,7 +395,7 @@ async function fillSettingsPage() {
|
|||
);
|
||||
}
|
||||
|
||||
export let settingsFillPromise = fillSettingsPage();
|
||||
// export let settingsFillPromise = fillSettingsPage();
|
||||
|
||||
export function hideAccountSection() {
|
||||
$(`.sectionGroupTitle[group='account']`).addClass("hidden");
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ export function changePage(page, norestart = false) {
|
|||
setTimeout(() => {
|
||||
if (check === "pageAccount" && page !== "account") {
|
||||
Account.reset();
|
||||
} else if (check === "pageSettings" && page !== "settings") {
|
||||
Settings.reset();
|
||||
}
|
||||
}, 250);
|
||||
|
||||
|
|
@ -196,7 +198,10 @@ export function changePage(page, norestart = false) {
|
|||
activePage = "pageSettings";
|
||||
});
|
||||
Funbox.activate("none");
|
||||
Settings.update();
|
||||
Settings.fillSettingsPage().then(() => {
|
||||
Settings.update();
|
||||
});
|
||||
// Settings.update();
|
||||
TestConfig.hide();
|
||||
SignOutButton.hide();
|
||||
} else if (page == "account") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue