🐛 Automatic launch at boot does not work Fix https://github.com/siyuan-note/siyuan/issues/7978

This commit is contained in:
Liang Ding 2023-04-13 11:49:26 +08:00
parent 8075902681
commit 42c5dfcbda
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 13 additions and 9 deletions

View file

@ -358,13 +358,13 @@ const boot = () => {
// 当前页面链接使用浏览器打开
currentWindow.webContents.on("will-navigate", (event, url) => {
if (event.sender) {
const currentURL = new URL(event.sender.getURL());
if (url.startsWith(getServer(currentURL.port))) {
return;
}
const currentURL = new URL(event.sender.getURL());
if (url.startsWith(getServer(currentURL.port))) {
return;
}
event.preventDefault();
shell.openExternal(url);
event.preventDefault();
shell.openExternal(url);
}
});
@ -793,6 +793,9 @@ app.whenReady().then(() => {
item.webContents.send("siyuan-send_windows", data);
});
});
ipcMain.on("siyuan-auto-launch", (event, data) => {
app.setLoginItemSettings({openAtLogin: data.openAtLogin});
});
if (firstOpen) {
const firstOpenWindow = new BrowserWindow({