diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/electron/ipc-api/dnd.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/electron/ipc-api/dnd.ts b/src/electron/ipc-api/dnd.ts index 6b1777367..9bef0fe3c 100644 --- a/src/electron/ipc-api/dnd.ts +++ b/src/electron/ipc-api/dnd.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import { ipcMain } from 'electron'; | 1 | import { ipcMain } from 'electron'; |
2 | import { isMac } from '../../environment'; | 2 | import { isMac } from '../../environment'; |
3 | 3 | ||
4 | const { getDoNotDisturb } = require('macos-notification-state'); | ||
5 | |||
6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:dnd'); | 4 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:dnd'); |
7 | 5 | ||
8 | export default async () => { | 6 | export default async () => { |
@@ -11,6 +9,14 @@ export default async () => { | |||
11 | return false; | 9 | return false; |
12 | } | 10 | } |
13 | 11 | ||
12 | // eslint-disable-next-line global-require | ||
13 | const { getDoNotDisturb } = require('macos-notification-state'); | ||
14 | |||
15 | if (!getDoNotDisturb) { | ||
16 | debug("Could not load 'macos-notification-state' module"); | ||
17 | return false; | ||
18 | } | ||
19 | |||
14 | try { | 20 | try { |
15 | const isDND = getDoNotDisturb(); | 21 | const isDND = getDoNotDisturb(); |
16 | debug('Fetching DND state, set to', isDND); | 22 | debug('Fetching DND state, set to', isDND); |