diff --git a/app/src/dialog/index.ts b/app/src/dialog/index.ts index 1046959e6..bd2ac75c4 100644 --- a/app/src/dialog/index.ts +++ b/app/src/dialog/index.ts @@ -46,9 +46,6 @@ export class Dialog { } public destroy() { - if (this.disableClose) { - return false; - } this.element.remove(); if (this.destroyCallback) { this.destroyCallback(); @@ -59,7 +56,6 @@ export class Dialog { return true; } }); - return true; } public bindInput(inputElement: HTMLInputElement, enterEvent?: () => void) { diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index 332e29a05..38f991691 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -139,7 +139,6 @@ export const transactionError = (data: { code: number, data: string }) => { }); }); btnsElement[1].addEventListener("click", () => { - dialog.destroy(); fetchPost("/api/filetree/refreshFiletree", {}); }); }; diff --git a/app/src/protyle/ui/hideElements.ts b/app/src/protyle/ui/hideElements.ts index 95950f568..ea7a49260 100644 --- a/app/src/protyle/ui/hideElements.ts +++ b/app/src/protyle/ui/hideElements.ts @@ -3,9 +3,8 @@ export const hideElements = (panels: string[], protyle?: IProtyle) => { if (!protyle) { if (panels.includes("dialog")) { for (let i = 0; i < window.siyuan.dialogs.length; i++) { - if (window.siyuan.dialogs[i].destroy()) { - i--; - } + window.siyuan.dialogs[i].destroy() + i--; } } return; diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 058c9df7a..20a53faa5 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -287,7 +287,8 @@ export const globalShortcut = () => {
-` +`, + disableClose: true }); switchDialog.element.addEventListener(isMac() ? "contextmenu" : "click", (event) => { event.preventDefault();