mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
This commit is contained in:
parent
25b8f08470
commit
77bd2634e1
4 changed files with 16 additions and 10 deletions
|
|
@ -657,12 +657,14 @@ app.whenReady().then(() => {
|
|||
ipcMain.on('siyuan-export-close', (event, id) => {
|
||||
BrowserWindow.fromId(id).webContents.send('siyuan-export-close', data)
|
||||
})
|
||||
ipcMain.on('siyuan-quit', (id) => {
|
||||
ipcMain.on('siyuan-quit', (event, id) => {
|
||||
const mainWindow = BrowserWindow.fromId(id)
|
||||
let tray
|
||||
workspaces.find((item, index) => {
|
||||
if (item.id === id) {
|
||||
mainWindow.destroy()
|
||||
if (workspaces.length > 1) {
|
||||
mainWindow.destroy()
|
||||
}
|
||||
tray = item.tray
|
||||
workspaces.splice(index, 1)
|
||||
return true
|
||||
|
|
@ -830,9 +832,11 @@ app.on('second-instance', (event, commandLine) => {
|
|||
})
|
||||
|
||||
app.on('activate', () => {
|
||||
const mainWindow = workspaces[0].browserWindow
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.show()
|
||||
if (workspaces.length > 0) {
|
||||
const mainWindow = workspaces[0].browserWindow
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.show()
|
||||
}
|
||||
}
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
boot()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue