Compare commits
1 Commits
main
...
nexmoe/aut
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2bda907e0 |
@@ -44,7 +44,7 @@ subscriptionManager.on('subscriptions:updated', (subscriptions) => {
|
|||||||
mainWindow?.webContents.send('subscriptions:updated', subscriptions)
|
mainWindow?.webContents.send('subscriptions:updated', subscriptions)
|
||||||
})
|
})
|
||||||
|
|
||||||
export function createWindow(): void {
|
export function createWindow(startHidden = false): void {
|
||||||
const isMac = process.platform === 'darwin'
|
const isMac = process.platform === 'darwin'
|
||||||
const isWindows = process.platform === 'win32'
|
const isWindows = process.platform === 'win32'
|
||||||
|
|
||||||
@@ -86,6 +86,9 @@ export function createWindow(): void {
|
|||||||
})
|
})
|
||||||
|
|
||||||
mainWindow.on('ready-to-show', () => {
|
mainWindow.on('ready-to-show', () => {
|
||||||
|
if (startHidden) {
|
||||||
|
return
|
||||||
|
}
|
||||||
mainWindow?.show()
|
mainWindow?.show()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -298,10 +301,19 @@ app.whenReady().then(async () => {
|
|||||||
log.error('Failed to initialize yt-dlp:', error)
|
log.error('Failed to initialize yt-dlp:', error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!settingsManager.get('launchAtLogin')) {
|
||||||
|
settingsManager.set('launchAtLogin', true)
|
||||||
|
}
|
||||||
|
|
||||||
applyDockVisibility(settingsManager.get('hideDockIcon'))
|
applyDockVisibility(settingsManager.get('hideDockIcon'))
|
||||||
applyAutoLaunchSetting(settingsManager.get('launchAtLogin'))
|
applyAutoLaunchSetting(settingsManager.get('launchAtLogin'))
|
||||||
|
|
||||||
createWindow()
|
const loginItemSettings = app.getLoginItemSettings()
|
||||||
|
const startHidden =
|
||||||
|
settingsManager.get('launchAtLogin') &&
|
||||||
|
(loginItemSettings.wasOpenedAtLogin || loginItemSettings.wasOpenedAsHidden)
|
||||||
|
|
||||||
|
createWindow(startHidden)
|
||||||
|
|
||||||
initAutoUpdater()
|
initAutoUpdater()
|
||||||
|
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ export const defaultSettings: AppSettings = {
|
|||||||
oneClickQuality: 'best',
|
oneClickQuality: 'best',
|
||||||
closeToTray: false,
|
closeToTray: false,
|
||||||
hideDockIcon: false,
|
hideDockIcon: false,
|
||||||
launchAtLogin: false,
|
launchAtLogin: true,
|
||||||
autoUpdate: true,
|
autoUpdate: true,
|
||||||
subscriptionFilenameTemplate: '%(uploader)s - %(title)s.%(ext)s',
|
subscriptionFilenameTemplate: '%(uploader)s - %(title)s.%(ext)s',
|
||||||
subscriptionOnlyLatestDefault: true,
|
subscriptionOnlyLatestDefault: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user