Fixed ThemePlaylist bug
This commit is contained in:
@@ -90,9 +90,9 @@ export function useCommonHooks() {
|
|||||||
|
|
||||||
const handleThemeChange = (themes: Theme[], save: boolean) => {
|
const handleThemeChange = (themes: Theme[], save: boolean) => {
|
||||||
const enabled = themes
|
const enabled = themes
|
||||||
.filter((t: Theme) => t.randomEnabled)
|
.filter((t: Theme) => t.randomEnabled === 1)
|
||||||
.filter((t: Theme) => t.name !== theme.name);
|
.filter((t: Theme) => t.name !== theme.name);
|
||||||
if (enabled.length === 0) {
|
if (enabled.length === 0 && currentThemePlaylist === 'All') {
|
||||||
setTheme(themes[0]);
|
setTheme(themes[0]);
|
||||||
save && setThemeName(themes[0].name);
|
save && setThemeName(themes[0].name);
|
||||||
} else if (currentThemePlaylist === 'All') {
|
} else if (currentThemePlaylist === 'All') {
|
||||||
|
|||||||
@@ -252,7 +252,9 @@ function ThemePlaylistCard({
|
|||||||
<ScrollArea h={'255px'} w={'100%'} style={{ zIndex: 2 }}>
|
<ScrollArea h={'255px'} w={'100%'} style={{ zIndex: 2 }}>
|
||||||
<Stack gap={4}>
|
<Stack gap={4}>
|
||||||
{themeList.length > 0 &&
|
{themeList.length > 0 &&
|
||||||
themeList.map((item: number) => {
|
themeList
|
||||||
|
.sort((a: any, b: any) => (a > b ? 1 : -1))
|
||||||
|
.map((item: number) => {
|
||||||
return (
|
return (
|
||||||
<ThemeMiniCard key={item} item={item} allThemes={allThemes} />
|
<ThemeMiniCard key={item} item={item} allThemes={allThemes} />
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user