From f1790ace34af20305babf783978d3d8bba41140b Mon Sep 17 00:00:00 2001
From: Alphrag <34252790+Alphrag@users.noreply.github.com>
Date: Sat, 1 Jun 2024 17:22:45 +0100
Subject: [PATCH] fix: macos-notification-state not working well (#1794)
---
build-helpers/entitlements.mas.inherit.plist | 2 ++
build-helpers/entitlements.mas.plist | 2 ++
src/electron/ipc-api/dnd.ts | 2 ++
3 files changed, 6 insertions(+)
diff --git a/build-helpers/entitlements.mas.inherit.plist b/build-helpers/entitlements.mas.inherit.plist
index 78c1f8d83c..6e7ea7cb9c 100644
--- a/build-helpers/entitlements.mas.inherit.plist
+++ b/build-helpers/entitlements.mas.inherit.plist
@@ -18,5 +18,7 @@
com.apple.security.automation.apple-events
+ com.apple.developer.usernotifications.communication
+
diff --git a/build-helpers/entitlements.mas.plist b/build-helpers/entitlements.mas.plist
index 78c1f8d83c..6e7ea7cb9c 100644
--- a/build-helpers/entitlements.mas.plist
+++ b/build-helpers/entitlements.mas.plist
@@ -18,5 +18,7 @@
com.apple.security.automation.apple-events
+ com.apple.developer.usernotifications.communication
+
diff --git a/src/electron/ipc-api/dnd.ts b/src/electron/ipc-api/dnd.ts
index 280521a9fb..577cd04489 100644
--- a/src/electron/ipc-api/dnd.ts
+++ b/src/electron/ipc-api/dnd.ts
@@ -8,6 +8,8 @@ export default async () => {
if (!isMac) {
return false;
}
+ // eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
+ // @ts-ignore
const { getDoNotDisturb } = await import('macos-notification-state');
if (!getDoNotDisturb) {