mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
0811e09728
commit
60fc810173
2 changed files with 9 additions and 5 deletions
|
|
@ -59,9 +59,13 @@ const exitApp = (port, errorWindowId) => {
|
|||
try {
|
||||
const currentURL = new URL(item.getURL());
|
||||
if (port.toString() === currentURL.port.toString()) {
|
||||
if (currentURL.href.indexOf("/stage/build/app/?v=") > -1) {
|
||||
mainWindow = item;
|
||||
} else {
|
||||
const hasMain = workspaces.find((workspaceItem) => {
|
||||
if (workspaceItem.browserWindow.id === item.id) {
|
||||
mainWindow = item
|
||||
return true;
|
||||
}
|
||||
})
|
||||
if (!hasMain) {
|
||||
item.destroy();
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +74,7 @@ const exitApp = (port, errorWindowId) => {
|
|||
}
|
||||
});
|
||||
workspaces.find((item, index) => {
|
||||
if (mainWindow.id === item.browserWindow.id) {
|
||||
if (mainWindow && mainWindow.id === item.browserWindow.id) {
|
||||
if (workspaces.length > 1) {
|
||||
item.browserWindow.destroy();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue