mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 桌面端快捷方式工作空间参数 --workspace 变更 Fix https://github.com/siyuan-note/siyuan/issues/7070
This commit is contained in:
parent
ef9c5450e8
commit
6b298f3f24
1 changed files with 7 additions and 4 deletions
|
|
@ -52,10 +52,8 @@ try {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
require('electron').
|
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
|
||||||
dialog.
|
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
||||||
showErrorBox('创建配置目录失败 Failed to create config directory',
|
|
||||||
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan),请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
|
|
||||||
app.exit()
|
app.exit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -901,12 +899,17 @@ app.on('second-instance', (event, argv) => {
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const siyuanURL = argv.find((arg) => arg.startsWith('siyuan://'))
|
const siyuanURL = argv.find((arg) => arg.startsWith('siyuan://'))
|
||||||
workspaces.forEach(item => {
|
workspaces.forEach(item => {
|
||||||
if (item.browserWindow && !item.browserWindow.isDestroyed() && siyuanURL) {
|
if (item.browserWindow && !item.browserWindow.isDestroyed() && siyuanURL) {
|
||||||
item.browserWindow.webContents.send('siyuan-openurl', siyuanURL)
|
item.browserWindow.webContents.send('siyuan-openurl', siyuanURL)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (!siyuanURL && 0 < workspaces.length) {
|
||||||
|
showWindow(workspaces[0].browserWindow)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue