From d443c7ecb00973c56e23110b532c000b5060e2a9 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 17 Jun 2021 00:54:06 +0200 Subject: [PATCH] Fix unofficial theme display --- UI/BigComponents/MoreScreen.ts | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/UI/BigComponents/MoreScreen.ts b/UI/BigComponents/MoreScreen.ts index a5de7896c..d4632b628 100644 --- a/UI/BigComponents/MoreScreen.ts +++ b/UI/BigComponents/MoreScreen.ts @@ -43,17 +43,18 @@ export default class MoreScreen extends Combine { } private static createUnofficialThemeList(buttonClass: string): BaseUIElement{ - const customThemes = State.state.installedThemes.data ?? []; - const els : BaseUIElement[] = [] - if (customThemes.length > 0) { - els.push(Translations.t.general.customThemeIntro) + return new VariableUiElement(State.state.installedThemes.map(customThemes => { + const els : BaseUIElement[] = [] + if (customThemes.length > 0) { + els.push(Translations.t.general.customThemeIntro.Clone()) - const customThemesElement = new Combine( - customThemes.map(theme => MoreScreen.createLinkButton(theme.layout, theme.definition)?.SetClass(buttonClass)) - ) - els.push(customThemesElement) - } - return new Combine(els) + const customThemesElement = new Combine( + customThemes.map(theme => MoreScreen.createLinkButton(theme.layout, theme.definition)?.SetClass(buttonClass)) + ) + els.push(customThemesElement) + } + return els; + })); } private static createOfficialThemesList(state: State, buttonClass: string): BaseUIElement {