diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts index cc57bfd8f..d97c7ba1d 100644 --- a/app/src/dialog/processSystem.ts +++ b/app/src/dialog/processSystem.ts @@ -301,7 +301,12 @@ export const exitSiYuan = async (setCurrentWorkspace = true) => { window.JSAndroid.exit(); return; } - if (isInIOS() || isInHarmony()) { + if (isInIOS()) { + window.webkit.messageHandlers.exit.postMessage(); + return; + } + + if (isInHarmony()) { window.location.href = "siyuan://api/system/exit"; } /// #endif @@ -352,7 +357,12 @@ export const exitSiYuan = async (setCurrentWorkspace = true) => { window.JSAndroid.exit(); return; } - if (isInIOS() || isInHarmony()) { + if (isInIOS()) { + window.webkit.messageHandlers.exit.postMessage(); + return; + } + + if (isInHarmony()) { window.location.href = "siyuan://api/system/exit"; } /// #endif diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index 903c05859..0d214a139 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -228,6 +228,7 @@ interface Window { setClipboard: { postMessage: (url: string) => void } purchase: { postMessage: (url: string) => void } print: { postMessage: (html: string) => void } + exit: { postMessage: () => void } } }; htmlToImage: {