From e2c26cd93955ff88855ad04ba4f822c7a4d625f1 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 9 Mar 2026 17:22:20 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/17167 --- app/src/plugin/platformUtils.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/plugin/platformUtils.ts b/app/src/plugin/platformUtils.ts index e0be2d9f0..bfd51f6a5 100644 --- a/app/src/plugin/platformUtils.ts +++ b/app/src/plugin/platformUtils.ts @@ -20,15 +20,13 @@ export const updateHotkeyTip = compatibility.updateHotkeyTip; export const getLocalStorage = compatibility.getLocalStorage; export const setStorageVal = compatibility.setStorageVal; -export interface ISendNotificationOptions { +export const sendNotification = (options: { channel?: string, title?: string, body?: string, delayInSeconds?: number, timeoutType?: "default" | "never" // 该参数仅在桌面端有效 -} - -export const sendNotification = (options: ISendNotificationOptions): Promise => { +}): Promise => { return new Promise((resolve) => { const title = options.title || ""; const body = options.body || ""; @@ -67,13 +65,12 @@ export const sendNotification = (options: ISendNotificationOptions): Promise { ipcRenderer.send(Constants.SIYUAN_CMD, { cmd: "notification", title, body, - timeoutType + timeoutType: options.timeoutType || "never" }); }, delayInSeconds * 1000); resolve(timeoutId); @@ -82,7 +79,7 @@ export const sendNotification = (options: ISendNotificationOptions): Promise { - if (id <= 0) { + if (id < 0) { return; } /// #if BROWSER