small ui changes

This commit is contained in:
2026-02-20 15:22:49 -05:00
parent 88c3736110
commit 84f027aedf
5 changed files with 105 additions and 36 deletions
@@ -65,6 +65,14 @@ export class PlaylistController implements ReactiveController {
playlistStore.setScrollPosition(offset);
}
// ===================================================================
// REFETCH
// ===================================================================
async refetch(): Promise<playlist.WithTracks[]> {
return playlistStore.refetch();
}
// ===================================================================
// INVALIDATION
// ===================================================================
+25
View File
@@ -90,6 +90,31 @@ class PlaylistStore {
this.scrollPosition = offset;
}
// ===================================================================
// REFETCH
// Fetches fresh data without clearing the cache first, so existing
// consumers keep rendering stale data until the new data arrives.
// ===================================================================
async refetch(): Promise<playlist.WithTracks[]> {
if (this.playlistsLoading) {
return this.waitForPlaylists();
}
this.playlistsLoading = true;
try {
const result =
await GetAllPlaylistsWithTracks();
this.playlists = result ?? [];
return this.playlists;
} finally {
this.playlistsLoading = false;
this.notify();
}
}
// ===================================================================
// INVALIDATION
// ===================================================================