Feature: on macos, tray icon can be hidden now

This commit is contained in:
萌萌哒赫萝
2023-04-09 17:58:09 +08:00
parent fe8112ba12
commit 4043dbfb25
6 changed files with 22 additions and 7 deletions

View File

@@ -154,8 +154,15 @@ class LifeCycle {
])
)
}
createTray()
const startMode = db.get('settings.startMode') || 'quiet'
if (startMode !== 'no-tray' && process.platform === 'darwin') {
createTray()
}
db.set('needReload', false)
const isHideDock = db.get('settings.isHideDock') || false
if (isHideDock) {
app.dock.hide()
}
updateChecker()
// 不需要阻塞
process.nextTick(() => {
@@ -175,7 +182,6 @@ class LifeCycle {
}
await remoteNoticeHandler.init()
remoteNoticeHandler.triggerHook(IRemoteNoticeTriggerHook.APP_START)
const startMode = db.get('settings.startMode') || 'quiet'
if (startMode === 'mini') {
windowManager.create(IWindowList.MINI_WINDOW)
const miniWindow = windowManager.get(IWindowList.MINI_WINDOW)!
@@ -204,10 +210,6 @@ class LifeCycle {
settingWindow.show()
settingWindow.focus()
}
const isHideDock = db.get('settings.isHideDock') || false
if (isHideDock) {
app.dock.hide()
}
}
app.whenReady().then(readyFunction)
}