Просмотр исходного кода

:bug: fix https://github.com/siyuan-note/siyuan/issues/9405

Vanessa 1 год назад
Родитель
Сommit
c5206f7084
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      app/electron/main.js

+ 3 - 2
app/electron/main.js

@@ -695,9 +695,10 @@ app.whenReady().then(() => {
                     return;
                     return;
                 }
                 }
                 const ids = decodeURIComponent(new URL(item.webContents.getURL()).hash.substring(1)).split("\u200b");
                 const ids = decodeURIComponent(new URL(item.webContents.getURL()).hash.substring(1)).split("\u200b");
-                if (ids.includes(data.options.rootID) || ids.includes(data.options.assetPath)) {
+                const options = JSON.parse(data.options);
+                if (ids.includes(options.rootID) || ids.includes(options.assetPath)) {
                     item.focus();
                     item.focus();
-                    item.webContents.send("siyuan-open-file", data.options);
+                    item.webContents.send("siyuan-open-file", options);
                     hasMatch = true;
                     hasMatch = true;
                     return true;
                     return true;
                 }
                 }