fix(award+home): reload AwardView on awardId change; drop ribbon from Essential Discography
- AwardView stayed on the same activeView when switching between awards via the 'Other awards' carousel, so onMount didn't re-fire and the old award's data persisted. Replaces the onMount trigger with a keyed on awardId: resets loading flags and calls loadHero/loadAlbums/loadOtherAwards whenever the prop changes. - Essential Discography albums all carry the Ideal Discography award by definition — the ribbon is redundant on every card. Drops the ribbon prop from the two AlbumCard call-sites for that rail. Ribbons still appear on New Releases, Press Accolades, Most Streamed, Qobuzissimes, Album of the Week, Editor's Picks and Forgotten Favorites. cc
This commit is contained in:
2 files changed
+19
-7
No files matched your search
@@ -5,7 +5,7 @@
|
||||
* hero info and uses the embedded releases arrays for the album
|
||||
* grids. Matches LabelView's overall structure.
|
||||
*/
|
||||
import { onMount, onDestroy } from 'svelte';
|
||||
import { onDestroy } from 'svelte';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { t } from '$lib/i18n';
|
||||
import { ArrowLeft, Award as AwardIcon, Heart, LoaderCircle, ArrowRight } from 'lucide-svelte';
|
||||
@@ -195,10 +195,24 @@
|
||||
await toggleAwardFavorite(awardId);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
loadHero();
|
||||
loadAlbums();
|
||||
loadOtherAwards();
|
||||
// Re-fetch whenever the awardId prop changes. Happens when the user
|
||||
// jumps between awards via the "Other awards" carousel — the view
|
||||
// stays mounted (same ViewType) so onMount wouldn't fire again.
|
||||
let lastLoadedId = '';
|
||||
$effect(() => {
|
||||
if (awardId && awardId !== lastLoadedId) {
|
||||
lastLoadedId = awardId;
|
||||
page = null;
|
||||
albums = [];
|
||||
totalEstimate = null;
|
||||
hasMore = false;
|
||||
error = null;
|
||||
heroImageFailed = false;
|
||||
loading = true;
|
||||
loadHero();
|
||||
loadAlbums();
|
||||
loadOtherAwards();
|
||||
}
|
||||
});
|
||||
|
||||
const displayName = $derived(page?.name ?? awardName ?? '');
|
||||
|
||||
@@ -1461,7 +1461,6 @@
|
||||
album.audio_info?.maximum_bit_depth,
|
||||
album.audio_info?.maximum_sampling_rate
|
||||
)}
|
||||
ribbon={pickAlbumRibbon(album.awards)}
|
||||
onPlay={onAlbumPlay ? () => onAlbumPlay(album.id) : undefined}
|
||||
onPlayNext={onAlbumPlayNext ? () => onAlbumPlayNext(album.id) : undefined}
|
||||
onPlayLater={onAlbumPlayLater ? () => onAlbumPlayLater(album.id) : undefined}
|
||||
@@ -2016,7 +2015,6 @@
|
||||
album.audio_info?.maximum_bit_depth,
|
||||
album.audio_info?.maximum_sampling_rate
|
||||
)}
|
||||
ribbon={pickAlbumRibbon(album.awards)}
|
||||
onPlay={onAlbumPlay ? () => onAlbumPlay(album.id) : undefined}
|
||||
onPlayNext={onAlbumPlayNext ? () => onAlbumPlayNext(album.id) : undefined}
|
||||
onPlayLater={onAlbumPlayLater ? () => onAlbumPlayLater(album.id) : undefined}
|
||||
|
||||
Reference in new issue
Block a user