From e46da79bbf4d206db710da332d8161a17618d2e6 Mon Sep 17 00:00:00 2001 From: m0rtus59 Date: Sat, 14 Nov 2026 13:10:32 +0500 Subject: [PATCH] Ignore stale media errors after moving images --- js/ui/mediaPreview.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/ui/mediaPreview.js b/js/ui/mediaPreview.js index a6c2574..7c9c019 100644 --- a/js/ui/mediaPreview.js +++ b/js/ui/mediaPreview.js @@ -568,6 +568,12 @@ export function renderCardImages(cardObj, state, onNavigateBatch) { const cardId = cardObj.element?.id || ""; + // Ignore a late error from the previous URL if this media element has + // already been pointed at a replacement file (for example after Move). + const failedUrl = new URL(src, window.location.origin).href; + const activeUrl = mediaEl.currentSrc || mediaEl.src; + if (activeUrl && activeUrl !== failedUrl) return; + // 1. If an intermediate output item is missing, remove only that image. // A node can have several images, so never discard the node's other outputs. if (cardId.startsWith("card-submenu-")) { @@ -642,6 +648,7 @@ export function renderCardImages(cardObj, state, onNavigateBatch) { // Keep the history card even if its file was removed. Missing media should // not erase history or prevent a later run from reusing the same output path. + renderCardImages(cardObj, liveState, onNavigateBatch); cardObj.grid.innerHTML = ""; cardObj.firstImgElement = null; cardObj.lastImagesSignature = "";