fixed some bugs

This commit is contained in:
kveld9
2026-04-12 20:43:31 -03:00
parent 9cb1471170
commit 592a479c30
12 changed files with 136 additions and 64 deletions
+3
View File
@@ -6,6 +6,7 @@ interface PlaylistStore {
recentIds: string[];
playlists: SubsonicPlaylist[];
playlistsLoading: boolean;
lastModified: Record<string, number>;
touchPlaylist: (id: string) => void;
removeId: (id: string) => void;
fetchPlaylists: () => Promise<void>;
@@ -19,9 +20,11 @@ export const usePlaylistStore = create<PlaylistStore>()(
recentIds: [],
playlists: [],
playlistsLoading: false,
lastModified: {},
touchPlaylist: (id) =>
set((s) => ({
recentIds: [id, ...s.recentIds.filter((x) => x !== id)].slice(0, 50),
lastModified: { ...s.lastModified, [id]: Date.now() },
})),
removeId: (id) =>
set((s) => ({ recentIds: s.recentIds.filter((x) => x !== id) })),