diff --git a/frontend/src/ts/commandline/commandline.ts b/frontend/src/ts/commandline/commandline.ts index 7afdf27ed4bc..5c96162c3fef 100644 --- a/frontend/src/ts/commandline/commandline.ts +++ b/frontend/src/ts/commandline/commandline.ts @@ -9,6 +9,7 @@ import * as Notifications from "../elements/notifications"; import * as OutOfFocus from "../test/out-of-focus"; import * as ActivePage from "../states/active-page"; import { focusWords } from "../test/test-ui"; +import * as Loader from "../elements/loader"; type CommandlineMode = "search" | "input"; type InputModeParams = { @@ -77,9 +78,11 @@ export function show( settings.subgroupOverride ); if (exists) { - subgroupOverride = CommandlineLists.getList( + Loader.show(); + subgroupOverride = await CommandlineLists.getList( settings.subgroupOverride as CommandlineLists.ListsObjectKeys ); + Loader.hide(); } else { subgroupOverride = null; usingSingleList = Config.singleListCommandLine === "on"; diff --git a/frontend/src/ts/commandline/lists.ts b/frontend/src/ts/commandline/lists.ts index 6282d6564e12..f766105f61a4 100644 --- a/frontend/src/ts/commandline/lists.ts +++ b/frontend/src/ts/commandline/lists.ts @@ -501,9 +501,17 @@ export function doesListExist(listName: string): boolean { return lists[listName as ListsObjectKeys] !== undefined; } -export function getList( +export async function getList( listName: ListsObjectKeys -): MonkeyTypes.CommandsSubgroup { +): Promise { + await Promise.allSettled([ + layoutsPromise, + languagesPromise, + funboxPromise, + fontsPromise, + themesPromise, + challengesPromise, + ]); const list = lists[listName]; if (!list) { Notifications.add(`List not found: ${listName}`, -1);