fix(ui): ensure album download state updates reactively in Home and Search views
Added downloadStatusTick counter to force Svelte 5 reactivity when albumDownloadStatuses Map changes. cp
This commit is contained in:
1 parent
a1df7095fb
commit
9443708aad
2 files changed
+6
-2
No files matched your search
@@ -165,13 +165,14 @@
|
||||
|
||||
// Download status tracking
|
||||
let albumDownloadStatuses = $state<Map<string, boolean>>(new Map());
|
||||
let downloadStatusTick = $state(0);
|
||||
|
||||
async function loadAlbumDownloadStatus(albumId: string) {
|
||||
if (!checkAlbumFullyDownloaded) return false;
|
||||
try {
|
||||
const isDownloaded = await checkAlbumFullyDownloaded(albumId);
|
||||
albumDownloadStatuses.set(albumId, isDownloaded);
|
||||
albumDownloadStatuses = albumDownloadStatuses;
|
||||
downloadStatusTick++;
|
||||
return isDownloaded;
|
||||
} catch {
|
||||
return false;
|
||||
@@ -185,6 +186,7 @@
|
||||
|
||||
function isAlbumDownloaded(albumId: string): boolean {
|
||||
void downloadStateVersion;
|
||||
void downloadStatusTick;
|
||||
return albumDownloadStatuses.get(albumId) || false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user