Skip to content

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

:art: Improve backward for HarmonyOS https://github.com/siyuan-note/siyuan/issues/13676

Daniele9f33724b054
diff --git a/app/src/mobile/util/MobileBackFoward.ts b/app/src/mobile/util/MobileBackFoward.ts
index 07f4816322..3d23e53571 100644
--- a/app/src/mobile/util/MobileBackFoward.ts
+++ b/app/src/mobile/util/MobileBackFoward.ts
@@ -153,9 +153,13 @@ export const goBack = () => {
closePanel();
return;
}
- if (window.JSAndroid && window.siyuan.backStack.length < 1) {
+ if ((window.JSAndroid || window.JSHarmony) && window.siyuan.backStack.length < 1) {
if (document.querySelector('#message [data-id="exitTip"]')) {
- window.JSAndroid.returnDesktop();
+ if (window.JSAndroid) {
+ window.JSAndroid.returnDesktop();
+ } else if (window.JSHarmony) {
+ window.JSHarmony.returnDesktop();
+ }
} else {
showMessage(window.siyuan.languages.returnDesktop, 3000, "info", "exitTip");
}
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 8aef8e29da..8eb1777739 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -199,6 +199,7 @@ interface Window {
writeClipboard(text: string): void
writeHTMLClipboard(text: string, html: string): void
readClipboard(): string
+ returnDesktop(): void
}
Protyle: import("../protyle/method").default