From 424baa110de0e5e140b614b20070cb6703936e7f Mon Sep 17 00:00:00 2001 From: DenOfEquity <166248528+DenOfEquity@users.noreply.github.com> Date: Sun, 25 Aug 2024 10:14:45 +0100 Subject: [PATCH] Update dragdrop.js remove unnecessary check for PNGInfo element enables repeated drag-drop into PNG Info fixes https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1485 --- javascript/dragdrop.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/javascript/dragdrop.js b/javascript/dragdrop.js index 882562d7..2b7a1456 100644 --- a/javascript/dragdrop.js +++ b/javascript/dragdrop.js @@ -26,26 +26,7 @@ function dropReplaceImage(imgWrap, files) { } }; - if (imgWrap.closest('#pnginfo_image')) { - // special treatment for PNG Info tab, wait for fetch request to finish - const oldFetch = window.fetch; - window.fetch = async(input, options) => { - const response = await oldFetch(input, options); - if ('api/predict/' === input) { - const content = await response.text(); - window.fetch = oldFetch; - window.requestAnimationFrame(() => callback()); - return new Response(content, { - status: response.status, - statusText: response.statusText, - headers: response.headers - }); - } - return response; - }; - } else { - window.requestAnimationFrame(() => callback()); - } + window.requestAnimationFrame(() => callback()); } function eventHasFiles(e) {