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