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
This commit is contained in:
DenOfEquity
2024-08-25 10:14:45 +01:00
committed by GitHub
parent 59dd981fa7
commit 424baa110d

View File

@@ -26,26 +26,7 @@ function dropReplaceImage(imgWrap, files) {
} }
}; };
if (imgWrap.closest('#pnginfo_image')) { window.requestAnimationFrame(() => callback());
// 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());
}
} }
function eventHasFiles(e) { function eventHasFiles(e) {