app: fix #218 and keep dock open on install

This commit is contained in:
Jeffrey Morgan
2023-07-27 10:53:38 -04:00
parent 31673d26d0
commit dbb3174cbc
3 changed files with 12 additions and 6 deletions

View File

@@ -36,6 +36,7 @@ app.on('ready', () => {
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.exit(0)
return
}
app.on('second-instance', () => {
@@ -56,10 +57,6 @@ app.on('ready', () => {
init()
})
if (process.platform === 'darwin') {
app.dock.hide()
}
function firstRunWindow() {
// Create the browser window.
welcomeWindow = new BrowserWindow({
@@ -198,6 +195,10 @@ function init() {
server()
if (store.get('first-time-run') && installed()) {
if (process.platform === 'darwin') {
app.dock.hide()
}
app.setLoginItemSettings({ openAtLogin: app.getLoginItemSettings().openAtLogin })
return
}