fix: handle viewer load errors

This commit is contained in:
William Valentin
2026-02-02 19:47:45 -08:00
parent eb712ac9e9
commit 1f8c28e1db

View File

@@ -175,6 +175,7 @@ export function MediaPanel(props: { selectedDayIso: string | null }) {
setViewerError(null);
setVideoFallback(null);
try {
if (asset.media_type === "video") {
const playback = await loadVideoPlaybackUrl(asset.id);
const variantLabel =
@@ -190,6 +191,12 @@ export function MediaPanel(props: { selectedDayIso: string | null }) {
const url = await loadSignedUrl(asset.id, variant);
setViewer({ asset, url, variant });
void loadAdminLists();
} catch (err) {
setViewer(null);
setViewerError(
err instanceof Error ? err.message : "viewer_open_failed",
);
}
}
async function loadAdminLists() {