Stop Apple from killing the Electron dev process when a notification is received (#2991)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import {app, shell, Notification} from 'electron';
|
import {app, shell, Notification} from 'electron';
|
||||||
|
import isDev from 'electron-is-dev';
|
||||||
import {getDoNotDisturb as getDarwinDoNotDisturb} from 'macos-notification-state';
|
import {getDoNotDisturb as getDarwinDoNotDisturb} from 'macos-notification-state';
|
||||||
|
|
||||||
import {PLAY_SOUND, NOTIFICATION_CLICKED} from 'common/communication';
|
import {PLAY_SOUND, NOTIFICATION_CLICKED} from 'common/communication';
|
||||||
@@ -179,7 +180,8 @@ async function getDoNotDisturb() {
|
|||||||
return getWindowsDoNotDisturb();
|
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();
|
return getDarwinDoNotDisturb();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user