Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure FT stay "running in background" on MacOS after all window closed #3526

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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()
Expand Down