Random theme bug fix
This commit is contained in:
@@ -213,6 +213,7 @@ function SettingsButton() {
|
|||||||
<ActionIcon
|
<ActionIcon
|
||||||
className={actionIconClasses.menuActions}
|
className={actionIconClasses.menuActions}
|
||||||
classNames={actionIconClasses}
|
classNames={actionIconClasses}
|
||||||
|
disabled={currentThemePlaylist === 'Time of Day'}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
currentTheme === 'random'
|
currentTheme === 'random'
|
||||||
@@ -246,16 +247,36 @@ function SettingsButton() {
|
|||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
color: 'var(--mantine-color-primary-0)',
|
color: 'var(--mantine-color-primary-0)',
|
||||||
}}
|
}}
|
||||||
|
disabled={currentThemePlaylist === 'Time of Day'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const themeList = JSON.parse(
|
const themeList = JSON.parse(
|
||||||
themePlaylistData?.find(
|
themePlaylistData?.find(
|
||||||
(t: ThemePlaylist) => t?.name === currentThemePlaylist,
|
(t: ThemePlaylist) => t?.name === currentThemePlaylist,
|
||||||
)?.themeList ?? '[]',
|
)?.themeList ?? '[]',
|
||||||
);
|
);
|
||||||
const filteredThemes = allThemes.filter((t: Theme) =>
|
if (themeList.length > 0) {
|
||||||
themeList.includes(t.id),
|
const filteredThemes = allThemes.filter((t: Theme) =>
|
||||||
);
|
themeList.includes(t.id),
|
||||||
handleThemeChange(filteredThemes, false);
|
);
|
||||||
|
handleThemeChange(filteredThemes, false);
|
||||||
|
} else if (currentThemePlaylist === 'All') {
|
||||||
|
handleThemeChange(allThemes, false);
|
||||||
|
} else if (currentThemePlaylist === 'Backgrounds') {
|
||||||
|
handleThemeChange(
|
||||||
|
allThemes.filter(
|
||||||
|
(a: any) =>
|
||||||
|
!a.backgroundImage.toLowerCase().includes('none'),
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
} else if (currentThemePlaylist === 'No Backgrounds') {
|
||||||
|
handleThemeChange(
|
||||||
|
allThemes.filter((a: any) =>
|
||||||
|
a.backgroundImage.toLowerCase().includes('none'),
|
||||||
|
),
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FaDice />
|
<FaDice />
|
||||||
|
|||||||
Reference in New Issue
Block a user