Fix unofficial theme display

This commit is contained in:
pietervdvn 2021-06-17 00:54:06 +02:00
parent 6c3b8b2020
commit d443c7ecb0

View file

@ -43,17 +43,18 @@ export default class MoreScreen extends Combine {
} }
private static createUnofficialThemeList(buttonClass: string): BaseUIElement{ private static createUnofficialThemeList(buttonClass: string): BaseUIElement{
const customThemes = State.state.installedThemes.data ?? []; return new VariableUiElement(State.state.installedThemes.map(customThemes => {
const els : BaseUIElement[] = [] const els : BaseUIElement[] = []
if (customThemes.length > 0) { if (customThemes.length > 0) {
els.push(Translations.t.general.customThemeIntro) els.push(Translations.t.general.customThemeIntro.Clone())
const customThemesElement = new Combine( const customThemesElement = new Combine(
customThemes.map(theme => MoreScreen.createLinkButton(theme.layout, theme.definition)?.SetClass(buttonClass)) customThemes.map(theme => MoreScreen.createLinkButton(theme.layout, theme.definition)?.SetClass(buttonClass))
) )
els.push(customThemesElement) els.push(customThemesElement)
} }
return new Combine(els) return els;
}));
} }
private static createOfficialThemesList(state: State, buttonClass: string): BaseUIElement { private static createOfficialThemesList(state: State, buttonClass: string): BaseUIElement {