From d99e4ca4c94dfe95de42eb08342c84e582c19180 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 17 Oct 2022 14:03:15 +0200 Subject: [PATCH] making sure the buttons are ready updating active buttons --- frontend/src/ts/account/result-filters.ts | 6 +++--- frontend/src/ts/pages/account.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/ts/account/result-filters.ts b/frontend/src/ts/account/result-filters.ts index 602064c91..1975bb73d 100644 --- a/frontend/src/ts/account/result-filters.ts +++ b/frontend/src/ts/account/result-filters.ts @@ -675,8 +675,8 @@ $(".pageAccount .topFilters .button.toggleAdvancedFilters").on("click", () => { ); }); -export function appendButtons(): void { - Misc.getLanguageList().then((languages) => { +export async function appendButtons(): Promise { + await Misc.getLanguageList().then((languages) => { languages.forEach((language) => { $( ".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons" @@ -692,7 +692,7 @@ export function appendButtons(): void { $( ".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons" ).append(`
none
`); - Misc.getFunboxList().then((funboxModes) => { + await Misc.getFunboxList().then((funboxModes) => { funboxModes.forEach((funbox) => { $( ".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons" diff --git a/frontend/src/ts/pages/account.ts b/frontend/src/ts/pages/account.ts index b7fb4c743..c098f1241 100644 --- a/frontend/src/ts/pages/account.ts +++ b/frontend/src/ts/pages/account.ts @@ -1172,7 +1172,8 @@ export const page = new Page( ResultFilters.removeButtons(); }, async () => { - ResultFilters.appendButtons(); + await ResultFilters.appendButtons(); + ResultFilters.updateActive(); if (DB.getSnapshot()?.results == undefined) { $(".pageLoading .fill, .pageAccount .fill").css("width", "0%"); $(".pageAccount .content").addClass("hidden");