mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
This commit is contained in:
+10
-6
@@ -57,13 +57,17 @@ const exitApp = (port, errorWindowId) => {
|
||||
|
||||
// 关闭端口相同的所有非主窗口
|
||||
BrowserWindow.getAllWindows().forEach((item) => {
|
||||
const currentURL = new URL(item.getURL())
|
||||
if (port.toString() === currentURL.port.toString()) {
|
||||
if (currentURL.href.indexOf("/stage/build/app/?v=") > -1) {
|
||||
mainWindow = item;
|
||||
} else {
|
||||
item.destroy();
|
||||
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 {
|
||||
item.destroy();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// load file is not a url
|
||||
}
|
||||
});
|
||||
workspaces.find((item, index) => {
|
||||
|
||||
Reference in New Issue
Block a user