From ba8578273f4df51d6d53c0490072d4232032c68a Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Fri, 22 Mar 2024 13:12:06 -0400 Subject: [PATCH] Stop Apple from killing the Electron dev process when a notification is received (#2991) --- src/main/notifications/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/notifications/index.ts b/src/main/notifications/index.ts index 5cfda980..093dcdf2 100644 --- a/src/main/notifications/index.ts +++ b/src/main/notifications/index.ts @@ -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(); }