Bugfix for null themePlaylists

This commit is contained in:
2026-01-05 21:41:09 -06:00
parent 0df4f28f40
commit 38285943cd
3 changed files with 62 additions and 62 deletions

View File

@@ -81,7 +81,7 @@ function App() {
);
useEffect(() => {
if (allThemes && themeName && personalData) {
if (allThemes && themeName && personalData && isThemePlaylistsFetched) {
if (currentThemePlaylist === 'All') {
if (themeName === 'random') {
handleThemeChange(allThemes, false);
@@ -91,7 +91,7 @@ function App() {
}
} else if (currentThemePlaylist === 'Time of Day') {
const themeList = JSON.parse(
themePlaylists.find((t: ThemePlaylist) => t.name === currentThemePlaylist)
themePlaylists?.find((t: ThemePlaylist) => t.name === currentThemePlaylist)
.themeList,
);
setTheme(
@@ -112,7 +112,7 @@ function App() {
);
} else {
const themeList = JSON.parse(
themePlaylists.find((t: ThemePlaylist) => t.name === currentThemePlaylist)
themePlaylists?.find((t: ThemePlaylist) => t.name === currentThemePlaylist)
.themeList,
);
const filteredThemes = allThemes.filter((t: Theme) => themeList.includes(t.id));