Skip to content

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

:art: hide msg

Vanessa1fbe68f728fc
diff --git a/app/src/dialog/message.ts b/app/src/dialog/message.ts
index 44c48e8977..54319b1111 100644
--- a/app/src/dialog/message.ts
+++ b/app/src/dialog/message.ts
@@ -75,16 +75,23 @@ export const showMessage = (message: string, timeout = 6000, type = "info", mess
return id;
};
-export const hideMessage = (id: string) => {
+export const hideMessage = (id?: string) => {
const messagesElement = document.getElementById("message").firstElementChild;
- const messageElement = messagesElement.querySelector(`[data-id="${id}"]`);
- if (messageElement) {
- messageElement.classList.add("b3-snackbar--hide");
+ if (id) {
+ const messageElement = messagesElement.querySelector(`[data-id="${id}"]`);
+ if (messageElement) {
+ messageElement.classList.add("b3-snackbar--hide");
+ setTimeout(() => {
+ messageElement.remove();
+ }, Constants.TIMEOUT_INPUT);
+ }
+ if (messagesElement.childElementCount < 2) {
+ messagesElement.parentElement.classList.remove("b3-snackbars--show");
+ }
+ } else {
+ messagesElement.parentElement.classList.remove("b3-snackbars--show");
setTimeout(() => {
- messageElement.remove();
+ messagesElement.innerHTML = "";
}, Constants.TIMEOUT_INPUT);
}
- if (messagesElement.childElementCount < 2) {
- messagesElement.parentElement.classList.remove("b3-snackbars--show");
- }
};
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts
index 718c03266f..dec3b49ec9 100644
--- a/app/src/dialog/processSystem.ts
+++ b/app/src/dialog/processSystem.ts
@@ -5,7 +5,7 @@ import {getAllModels} from "../layout/getAll";
import {ipcRenderer} from "electron";
import {exportLayout} from "../layout/util";
/// #endif
-import {showMessage} from "./message";
+import {hideMessage, showMessage} from "./message";
import {Dialog} from "./index";
import {isMobile} from "../util/functions";
import {confirmDialog} from "./confirmDialog";
@@ -102,6 +102,7 @@ export const exitSiYuan = () => {
});
}
} else if (response.code === 2) { // 提示新安装包
+ hideMessage();
confirmDialog(window.siyuan.languages.tip, response.msg, () => {
fetchPost("/api/system/exit", {
force: true,