mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
988fb70691
commit
1ec4bb950c
1 changed files with 10 additions and 6 deletions
|
|
@ -57,13 +57,17 @@ const exitApp = (port, errorWindowId) => {
|
||||||
|
|
||||||
// 关闭端口相同的所有非主窗口
|
// 关闭端口相同的所有非主窗口
|
||||||
BrowserWindow.getAllWindows().forEach((item) => {
|
BrowserWindow.getAllWindows().forEach((item) => {
|
||||||
const currentURL = new URL(item.getURL())
|
try {
|
||||||
if (port.toString() === currentURL.port.toString()) {
|
const currentURL = new URL(item.getURL())
|
||||||
if (currentURL.href.indexOf("/stage/build/app/?v=") > -1) {
|
if (port.toString() === currentURL.port.toString()) {
|
||||||
mainWindow = item;
|
if (currentURL.href.indexOf("/stage/build/app/?v=") > -1) {
|
||||||
} else {
|
mainWindow = item;
|
||||||
item.destroy();
|
} else {
|
||||||
|
item.destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// load file is not a url
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
workspaces.find((item, index) => {
|
workspaces.find((item, index) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue