Stop Apple from killing the Electron dev process when a notification is received (#2991)

This commit is contained in:
Devin Binnie 2024-03-22 13:12:06 -04:00 committed by GitHub
parent da59e13477
commit ba8578273f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,7 @@
// See LICENSE.txt for license information.
import {app, shell, Notification} from 'electron';
import isDev from 'electron-is-dev';
import {getDoNotDisturb as getDarwinDoNotDisturb} from 'macos-notification-state';
import {PLAY_SOUND, NOTIFICATION_CLICKED} from 'common/communication';
@ -179,7 +180,8 @@ async function getDoNotDisturb() {
return getWindowsDoNotDisturb();
}
if (process.platform === 'darwin') {
// We have to turn this off for dev mode because the Electron binary doesn't have the focus center API entitlement
if (process.platform === 'darwin' && !isDev) {
return getDarwinDoNotDisturb();
}