From f1e46a7d099d0c520722883f5b24eb48c36cc80f Mon Sep 17 00:00:00 2001 From: Sample_Text <155495184+SampleTexting@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:37:52 -0600 Subject: [PATCH] Adding relative pathing to imagefeed and showimageonmenu for functionality within stableswarmui --- web/js/imageFeed.js | 2 +- web/js/showImageOnMenu.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/js/imageFeed.js b/web/js/imageFeed.js index b477912..e214d22 100644 --- a/web/js/imageFeed.js +++ b/web/js/imageFeed.js @@ -410,7 +410,7 @@ app.registerExtension({ api.addEventListener("executed", ({ detail }) => { if (visible && detail?.output?.images) { for (const src of detail.output.images) { - const href = `/view?filename=${encodeURIComponent(src.filename)}&type=${ + const href = `./view?filename=${encodeURIComponent(src.filename)}&type=${ src.type }&subfolder=${encodeURIComponent(src.subfolder)}&t=${+new Date()}`; diff --git a/web/js/showImageOnMenu.js b/web/js/showImageOnMenu.js index c38b5e7..4f4bcbe 100644 --- a/web/js/showImageOnMenu.js +++ b/web/js/showImageOnMenu.js @@ -51,7 +51,7 @@ const ext = { const images = detail?.output?.images; if (!images) return; const format = app.getPreviewFormatParam(); - const src = `/view?filename=${encodeURIComponent(images[0].filename)}&type=${ + const src = `./view?filename=${encodeURIComponent(images[0].filename)}&type=${ images[0].type }&subfolder=${encodeURIComponent(images[0].subfolder)}&t=${+new Date()}${format}`; show(src, detail.node);