mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/9368 open new window
This commit is contained in:
parent
797716fa1d
commit
56f4b6274d
6 changed files with 35 additions and 31 deletions
|
|
@ -683,6 +683,22 @@ app.whenReady().then(() => {
|
|||
if (data.cmd === "printToPDF") {
|
||||
return getWindowByContentId(data.webContentsId).webContents.printToPDF(data.pdfOptions);
|
||||
}
|
||||
if (data.cmd === "siyuan-open-file") {
|
||||
let hasMatch = false;
|
||||
BrowserWindow.getAllWindows().find(item => {
|
||||
if (item.webContents.id === event.sender.id) {
|
||||
return;
|
||||
}
|
||||
const ids = decodeURIComponent(new URL(item.webContents.getURL()).hash.substring(1)).split("\u200b");
|
||||
if (ids.includes(data.options.rootID) || ids.includes(data.options.assetPath)) {
|
||||
item.focus();
|
||||
item.webContents.send("siyuan-open-file", data.options);
|
||||
hasMatch = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return hasMatch
|
||||
}
|
||||
});
|
||||
ipcMain.on("siyuan-cmd", (event, data) => {
|
||||
let cmd = data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue