Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/13108

Vanessa5e3d472edb5b
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index 08af0f653a..a9977db8ae 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -876,6 +876,9 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
}
if (event.key === "Delete" || (event.key === "Backspace" && isMac())) {
window.siyuan.menus.menu.remove();
+ if (document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_CONFIRM}"]`)) {
+ return;
+ }
deleteFiles(liElements);
return true;
}
diff --git a/app/src/constants.ts b/app/src/constants.ts
index c56e53b0a8..9adafe660c 100644
--- a/app/src/constants.ts
+++ b/app/src/constants.ts
@@ -126,6 +126,7 @@ export abstract class Constants {
public static readonly LOCAL_EMOJIS = "local-emojis";
// dialog
+ public static readonly DIALOG_CONFIRM = "dialog-confirm";
public static readonly DIALOG_OPENCARD = "dialog-opencard";
public static readonly DIALOG_MAKECARD = "dialog-makecard";
public static readonly DIALOG_VIEWCARDS = "dialog-viewcards";
diff --git a/app/src/dialog/confirmDialog.ts b/app/src/dialog/confirmDialog.ts
index 56649aec6c..a8e2a09a3d 100644
--- a/app/src/dialog/confirmDialog.ts
+++ b/app/src/dialog/confirmDialog.ts
@@ -1,5 +1,6 @@
import {isMobile} from "../util/functions";
import {Dialog} from "./index";
+import {Constants} from "../constants";
export const confirmDialog = (title: string, text: string,
confirm?: (dialog?: Dialog) => void,
@@ -33,4 +34,5 @@ export const confirmDialog = (title: string, text: string,
}
dialog.destroy();
});
+ dialog.element.setAttribute("data-key", Constants.DIALOG_CONFIRM);
};