Applying changes from latest CR

- Replaced custom event with load event
- Removed the custom event dispatch
This commit is contained in:
patriceac 2022-12-29 09:26:32 -08:00
parent f7193966fb
commit 21e3299b7a

View File

@ -326,13 +326,12 @@ function restoreTaskToUI(task, fieldsToSkip) {
} }
else if (task.reqBody.init_image !== undefined) { else if (task.reqBody.init_image !== undefined) {
// listen for inpainter loading event, which happens AFTER the main image loads (which reloads the inpainter) // 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)) { if (Boolean(task.reqBody.mask)) {
imageInpainter.setImg(task.reqBody.mask) imageInpainter.setImg(task.reqBody.mask)
} }
}, { once: true }) }, { once: true })
initImagePreview.src = task.reqBody.init_image initImagePreview.src = task.reqBody.init_image
initImagePreview.dispatchEvent(new Event("load"))
} }
} }
function readUI() { function readUI() {