Browse Source

fix: Song thumbnail background not always visible after falling back

Owen Diffey 1 year ago
parent
commit
14a4ade558
1 changed files with 8 additions and 5 deletions
  1. 8 5
      frontend/src/components/SongThumbnail.vue

+ 8 - 5
frontend/src/components/SongThumbnail.vue

@@ -47,6 +47,13 @@ const thumbnail = computed(() => {
 	return "/assets/notes-transparent.png";
 });
 
+const backgroundVisible = computed(
+	() =>
+		loaded.value &&
+		thumbnail.value !== "/assets/notes-transparent.png" &&
+		!((!props.fallback || loadError.value === -1) && isNotesThumbnail.value)
+);
+
 const onLoadError = () => {
 	// Error codes
 	// -1 - Error occured, fallback disabled
@@ -83,11 +90,7 @@ watch(
 	<div class="thumbnail">
 		<slot name="icon" />
 		<div
-			v-if="
-				loaded &&
-				!isNotesThumbnail &&
-				thumbnail !== '/assets/notes-transparent.png'
-			"
+			v-if="backgroundVisible"
 			class="thumbnail-bg"
 			:style="{
 				'background-image': `url('${thumbnail}')`