mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
92576d3227
commit
786f1d1e1e
1 changed files with 11 additions and 1 deletions
|
|
@ -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 (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 => {
|
workspaces.forEach(item => {
|
||||||
if (item.browserWindow && !item.browserWindow.isDestroyed()) {
|
if (item.browserWindow && !item.browserWindow.isDestroyed()) {
|
||||||
item.browserWindow.webContents.send("siyuan-open-url", url);
|
item.browserWindow.webContents.send("siyuan-open-url", url);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue