Skip to content

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

:bug: https://github.com/siyuan-note/siyuan/issues/4567

Vanessa7199b5b19336
diff --git a/app/electron/main.js b/app/electron/main.js
index 599f6538a6..178b2af9ff 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -662,7 +662,7 @@ app.whenReady().then(() => {
BrowserWindow.fromId(data.id).webContents.send('siyuan-export-pdf', data)
})
ipcMain.on('siyuan-export-close', (event, id) => {
- BrowserWindow.fromId(id).webContents.send('siyuan-export-close', data)
+ BrowserWindow.fromId(id).webContents.send('siyuan-export-close', id)
})
ipcMain.on('siyuan-quit', (event, id) => {
const mainWindow = BrowserWindow.fromId(id)
@@ -771,12 +771,14 @@ app.whenReady().then(() => {
mainWindow.show()
}
}
- workspaces.find(item => {
- if (item.id === data.id) {
- resetTrayMenu(item.tray, data.languages, mainWindow)
- return true
- }
- })
+ if ('win32' === process.platform || 'linux' === process.platform) {
+ workspaces.find(item => {
+ if (item.id === data.id) {
+ resetTrayMenu(item.tray, data.languages, mainWindow)
+ return true
+ }
+ })
+ }
})
})
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts
index ddacddf541..56aff5d23e 100644
--- a/app/src/protyle/export/index.ts
+++ b/app/src/protyle/export/index.ts
@@ -414,14 +414,15 @@ const renderPDF = (id: string) => {
actionElement.querySelector("#landscape").addEventListener('change', () => {
setPadding();
});
+ const currentWindowId = ${getCurrentWindow().id};
actionElement.querySelector('.b3-button--cancel').addEventListener('click', () => {
const {ipcRenderer} = require("electron");
- ipcRenderer.send("${Constants.SIYUAN_EXPORT_CLOSE}", getCurrentWindow().id)
+ ipcRenderer.send("${Constants.SIYUAN_EXPORT_CLOSE}", currentWindowId)
});
actionElement.querySelector('.b3-button--text').addEventListener('click', () => {
const {ipcRenderer} = require("electron");
ipcRenderer.send("${Constants.SIYUAN_EXPORT_PDF}", {
- id: getCurrentWindow().id,
+ id: currentWindowId,
pdfOptions:{
printBackground: true,
landscape: actionElement.querySelector("#landscape").checked,