fix(preview): show fallback when image loading fails

Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
2026-08-31 22:40:41 -04:00
parent 7c241f2228
commit 631c35a00a
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -3,6 +3,7 @@ import { ref, computed, onMounted, onUnmounted } from 'vue'
import type { MediaLeafProps } from '@/types' import type { MediaLeafProps } from '@/types'
const props = defineProps<MediaLeafProps>() const props = defineProps<MediaLeafProps>()
const emit = defineEmits<{ error: [] }>()
// ── Pan / zoom state ──────────────────────────────────────────────────────── // ── Pan / zoom state ────────────────────────────────────────────────────────
@@ -103,6 +104,7 @@ onUnmounted(() => {
transformOrigin: 'center center', transformOrigin: 'center center',
}" }"
draggable="false" draggable="false"
@error="emit('error')"
/> />
<!-- Zoom hint --> <!-- Zoom hint -->
+1
View File
@@ -82,6 +82,7 @@ defineExpose({
:item="item" :item="item"
:presentation="presentation" :presentation="presentation"
class="media-stage__viewer" class="media-stage__viewer"
@error="error = true; url = ''"
/> />
</template> </template>
<template #fallback> <template #fallback>