Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/10937

Vanessa786f1d1e1e09
diff --git a/app/electron/main.js b/app/electron/main.js
index e644462ca0..0bae340644 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -1200,8 +1200,18 @@ app.whenReady().then(() => {
});
});
-app.on("open-url", (event, url) => { // for macOS
+app.on("open-url", async (event, url) => { // for macOS
if (url.startsWith("siyuan://")) {
+ if (workspaces.length === 0) {
+ let index = 0;
+ while (index < 10) {
+ index++;
+ await sleep(500);
+ if (workspaces.length > 0) {
+ break;
+ }
+ }
+ }
workspaces.forEach(item => {
if (item.browserWindow && !item.browserWindow.isDestroyed()) {
item.browserWindow.webContents.send("siyuan-open-url", url);