mirror of
https://github.com/FreeTubeApp/FreeTube
synced 2024-12-12 12:39:30 +01:00
! Ensure FT stay "running in background" on MacOS after all window closed (#3526)
This commit is contained in:
parent
8646e93f7f
commit
4363c71ab4
@ -975,7 +975,7 @@ function runApp() {
|
||||
|
||||
// ************************************************* //
|
||||
|
||||
app.once('window-all-closed', () => {
|
||||
app.on('window-all-closed', () => {
|
||||
// Clear cache and storage if it's the last window
|
||||
session.defaultSession.clearCache()
|
||||
session.defaultSession.clearStorageData({
|
||||
@ -991,11 +991,15 @@ function runApp() {
|
||||
]
|
||||
})
|
||||
|
||||
// For MacOS the app would still "run in background"
|
||||
// and create new window on event `activate`
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
|
||||
// MacOS event
|
||||
// https://www.electronjs.org/docs/latest/api/app#event-activate-macos
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow()
|
||||
|
Loading…
Reference in New Issue
Block a user