fix(album-sidebar): keep award card always clickable; toast if id missing
Previously disabled={!onAwardClick || !award.id} grayed out the award
card whenever /album/get returned an award entry without an id. User
reported the award was 'no longer clickable' on albums opened from the
artist page. Now the button always accepts clicks and the handler
shows a toast when no id is available instead of silently doing
nothing — keeps the affordance honest without sending 'null' to
/award/page.
cc
This commit is contained in:
7 files changed
+19
-8
No files matched your search
@@ -764,8 +764,8 @@
|
||||
<button
|
||||
class="sidebar-entity-card"
|
||||
type="button"
|
||||
onclick={() => { if (award.id && onAwardClick) onAwardClick(award.id, award.name); }}
|
||||
disabled={!onAwardClick || !award.id}
|
||||
onclick={() => onAwardClick?.(award.id ?? '', award.name)}
|
||||
disabled={!onAwardClick}
|
||||
>
|
||||
<div class="sidebar-entity-avatar award-avatar">
|
||||
<Award size={22} />
|
||||
|
||||
@@ -1686,7 +1686,8 @@
|
||||
"newState": "Blacklist {status}"
|
||||
},
|
||||
"laodingDevices": "Geräte werden geladen...",
|
||||
"findingSimilarArtists": "Suche nach ähnlichen Künstlern..."
|
||||
"findingSimilarArtists": "Suche nach ähnlichen Künstlern...",
|
||||
"awardUnavailable": "Detailansicht für diese Auszeichnung nicht verfügbar."
|
||||
},
|
||||
"offline": {
|
||||
"title": "Offline-Modus",
|
||||
|
||||
@@ -1709,7 +1709,8 @@
|
||||
"loadingDevices": "Loading devices...",
|
||||
"addedToPlaylist": "Added to playlist",
|
||||
"copied": "Copied!",
|
||||
"findingSimilarArtists": "Finding similar artists..."
|
||||
"findingSimilarArtists": "Finding similar artists...",
|
||||
"awardUnavailable": "Award detail not available for this entry."
|
||||
},
|
||||
"offline": {
|
||||
"title": "Offline Mode",
|
||||
|
||||
@@ -1709,7 +1709,8 @@
|
||||
"copied": "¡Copiado!",
|
||||
"loadingCredits": "Cargando créditos...",
|
||||
"laodingDevices": "Cargando dispositivos...",
|
||||
"findingSimilarArtists": "Encontrar artistas similares..."
|
||||
"findingSimilarArtists": "Encontrar artistas similares...",
|
||||
"awardUnavailable": "No hay detalle disponible para este premio."
|
||||
},
|
||||
"offline": {
|
||||
"title": "Modo Offline",
|
||||
|
||||
@@ -1686,7 +1686,8 @@
|
||||
"loadingCredits": "Chargement des crédits...",
|
||||
"loadingDevices": "Chargement des appareils...",
|
||||
"playlistUpdated": "Playlist mise à jour",
|
||||
"findingSimilarArtists": "Trouver des artistes similaires..."
|
||||
"findingSimilarArtists": "Trouver des artistes similaires...",
|
||||
"awardUnavailable": "Détail non disponible pour cette récompense."
|
||||
},
|
||||
"offline": {
|
||||
"title": "Mode hors ligne",
|
||||
|
||||
@@ -1709,7 +1709,8 @@
|
||||
"newState": "Lista negra {status}"
|
||||
},
|
||||
"laodingDevices": "Carregando dispositivos...",
|
||||
"findingSimilarArtists": "Encontrando artistas semelhantes..."
|
||||
"findingSimilarArtists": "Encontrando artistas semelhantes...",
|
||||
"awardUnavailable": "Detalhe não disponível para este prêmio."
|
||||
},
|
||||
"offline": {
|
||||
"title": "Modo Offline",
|
||||
|
||||
@@ -1529,7 +1529,13 @@
|
||||
}
|
||||
|
||||
function handleAwardClick(awardId: string, awardName: string) {
|
||||
if (!awardId) return;
|
||||
if (!awardId) {
|
||||
// Some /album/get responses omit award.id. We still keep the
|
||||
// click affordance so it looks interactive, but there is no
|
||||
// target page to open — surface that to the user.
|
||||
showToast($t('toast.awardUnavailable'), 'info');
|
||||
return;
|
||||
}
|
||||
selectedAward = { id: awardId, name: awardName };
|
||||
navigateTo('award', awardId);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user