From 371730ac6940d065e94f035dd3022ea035ccd87d Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 25 Feb 2025 12:15:50 +1100 Subject: [PATCH] cancel in mask editor cancels the run --- js/popup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/popup.js b/js/popup.js index fc2c3a8..e441199 100644 --- a/js/popup.js +++ b/js/popup.js @@ -164,10 +164,16 @@ class Popup extends HTMLSpanElement { this.maybe_play_sound() ComfyApp.open_maskeditor() this.counter.classList.remove('hidden') - setTimeout(this.respond_after_maskeditor.bind(this), 1000) + setTimeout(this.respond_after_maskeditor.bind(this), 200) } respond_after_maskeditor() { + const cancel_button = document.getElementById("maskEditor_topBarCancelButton") + if (!cancel_button.filter_listener_added) { + cancel_button.addEventListener('click', (e)=>{ this.send_cancel() }) + cancel_button.filter_listener_added = true + } + if (document.getElementById('maskEditor').style.display == 'none' && !this.requested_resend) { this._send_response(this.node.imgs[0].src) } else {