diff --git a/interface/src/components/ThemeSelector.tsx b/interface/src/components/ThemeSelector.tsx index 5e012922..dfee00cd 100644 --- a/interface/src/components/ThemeSelector.tsx +++ b/interface/src/components/ThemeSelector.tsx @@ -22,14 +22,18 @@ const ThemeSelector = ({ selectedType, setSelectedType, isEditMode }: ThemeSelec useEffect(() => { const initializeThemes = async () => { - const downloaded = (await listThemes()).themes; + const downloaded = (await listThemes()); const initializedThemes = themesList.map(theme => ({ ...theme, - isDownloaded: downloaded.includes(theme.name), + isDownloaded: downloaded.themes.includes(theme.name), isLoading: false })); + if (downloaded.selectedTheme !== '') { + setEnabledThemeName(downloaded.selectedTheme); + } + initializedThemes.sort((a, b) => Number(b.isDownloaded) - Number(a.isDownloaded)); setThemes(initializedThemes);