Fixed ThemePlaylist bug

This commit is contained in:
2025-04-16 01:11:40 -05:00
parent 5697045fe6
commit 6b4babb1b2
2 changed files with 9 additions and 7 deletions

View File

@@ -90,9 +90,9 @@ export function useCommonHooks() {
const handleThemeChange = (themes: Theme[], save: boolean) => {
const enabled = themes
.filter((t: Theme) => t.randomEnabled)
.filter((t: Theme) => t.randomEnabled === 1)
.filter((t: Theme) => t.name !== theme.name);
if (enabled.length === 0) {
if (enabled.length === 0 && currentThemePlaylist === 'All') {
setTheme(themes[0]);
save && setThemeName(themes[0].name);
} else if (currentThemePlaylist === 'All') {

View File

@@ -252,7 +252,9 @@ function ThemePlaylistCard({
<ScrollArea h={'255px'} w={'100%'} style={{ zIndex: 2 }}>
<Stack gap={4}>
{themeList.length > 0 &&
themeList.map((item: number) => {
themeList
.sort((a: any, b: any) => (a > b ? 1 : -1))
.map((item: number) => {
return (
<ThemeMiniCard key={item} item={item} allThemes={allThemes} />
);