Main: Minor changes
This commit is contained in:
parent
2ce3110041
commit
d8d601cc08
|
@ -247,7 +247,7 @@ function runApp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show when loaded
|
// Show when loaded
|
||||||
newWindow.on('ready-to-show', () => {
|
newWindow.once('ready-to-show', () => {
|
||||||
newWindow.show()
|
newWindow.show()
|
||||||
newWindow.focus()
|
newWindow.focus()
|
||||||
})
|
})
|
||||||
|
@ -281,13 +281,13 @@ function runApp() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
ipcMain.on('appReady', () => {
|
ipcMain.once('appReady', () => {
|
||||||
if (startupUrl) {
|
if (startupUrl) {
|
||||||
mainWindow.webContents.send('openUrl', startupUrl)
|
mainWindow.webContents.send('openUrl', startupUrl)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.on('relaunchRequest', () => {
|
ipcMain.once('relaunchRequest', () => {
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
app.exit(parseInt(process.env.FREETUBE_RELAUNCH_EXIT_CODE))
|
app.exit(parseInt(process.env.FREETUBE_RELAUNCH_EXIT_CODE))
|
||||||
return
|
return
|
||||||
|
@ -383,7 +383,7 @@ function runApp() {
|
||||||
child.unref()
|
child.unref()
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.once('window-all-closed', () => {
|
||||||
// Clear cache and storage if it's the last window
|
// Clear cache and storage if it's the last window
|
||||||
session.defaultSession.clearCache()
|
session.defaultSession.clearCache()
|
||||||
session.defaultSession.clearStorageData({
|
session.defaultSession.clearStorageData({
|
||||||
|
@ -405,7 +405,7 @@ function runApp() {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
if (mainWindow === null || mainWindow === undefined) {
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
createWindow()
|
createWindow()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue