From 21e3299b7af2f4afe12bb477bcf46f8c58d0c87d Mon Sep 17 00:00:00 2001 From: patriceac <48073125+patriceac@users.noreply.github.com> Date: Thu, 29 Dec 2022 09:26:32 -0800 Subject: [PATCH] Applying changes from latest CR - Replaced custom event with load event - Removed the custom event dispatch --- ui/media/js/dnd.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index 3732db19..16d17c29 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -326,13 +326,12 @@ function restoreTaskToUI(task, fieldsToSkip) { } else if (task.reqBody.init_image !== undefined) { // listen for inpainter loading event, which happens AFTER the main image loads (which reloads the inpainter) - document.addEventListener('imagePainterLoad', function() { + initImagePreview.addEventListener('load', function() { if (Boolean(task.reqBody.mask)) { imageInpainter.setImg(task.reqBody.mask) } }, { once: true }) initImagePreview.src = task.reqBody.init_image - initImagePreview.dispatchEvent(new Event("load")) } } function readUI() {