From de2539628b4f10122ce68bc7d6b0f72e7a8d9e83 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 13 May 2023 14:21:18 +0900 Subject: [PATCH] patch: invalid close detection --- web/extensions/core/maskeditor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/extensions/core/maskeditor.js b/web/extensions/core/maskeditor.js index ef1449540..e828784a4 100644 --- a/web/extensions/core/maskeditor.js +++ b/web/extensions/core/maskeditor.js @@ -250,8 +250,9 @@ class MaskEditorDialog extends ComfyDialog { const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === 'attributes' && mutation.attributeName === 'style') { - if(self.last_display_style && self.last_display_style != 'none') + if(self.last_display_style && self.last_display_style != 'none' && self.element.style.display == 'none') { ComfyApp.onClipspaceEditorClosed(); + } self.last_display_style = self.element.style.display; } @@ -270,6 +271,7 @@ class MaskEditorDialog extends ComfyDialog { else { this.saveButton.innerText = "Save"; } + this.saveButton.disabled = false; this.element.style.display = "block"; this.element.style.zIndex = 8888; // NOTE: alert dialog must be high priority. @@ -619,6 +621,8 @@ class MaskEditorDialog extends ComfyDialog { formData.append('type', "input"); formData.append('subfolder', "clipspace"); + this.saveButton.innerText = "Saving..."; + this.saveButton.disabled = true; await uploadMask(item, formData); ComfyApp.onClipspaceEditorSave(); this.close();