fix(web): album ordering resets to stale order after opening asset viewer
Change album state from $derived to $state so local updates to album.order are not overwritten when SvelteKit re-fetches page data after navigating away from and back to the album (e.g. closing the asset viewer). An effect keeps album in sync with data.album when the album ID changes, so navigation between albums still works correctly. Fixes #28383pull/28719/head
parent
c42cea5ca9
commit
0b2055ca26
|
|
@ -206,7 +206,14 @@
|
|||
}
|
||||
});
|
||||
|
||||
let album = $derived(data.album);
|
||||
let album = $state(data.album);
|
||||
|
||||
$effect(() => {
|
||||
const newAlbum = data.album;
|
||||
if (newAlbum.id !== album.id) {
|
||||
album = newAlbum;
|
||||
}
|
||||
});
|
||||
let albumId = $derived(album.id);
|
||||
|
||||
const containsEditors = $derived(album?.shared && album.albumUsers.some(({ role }) => role === AlbumUserRole.Editor));
|
||||
|
|
|
|||
Loading…
Reference in New Issue