diff options
Diffstat (limited to 'src/electron')
-rw-r--r-- | src/electron/ipc-api/dnd.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/electron/ipc-api/dnd.js b/src/electron/ipc-api/dnd.js index da4d7781e..6fb8999a3 100644 --- a/src/electron/ipc-api/dnd.js +++ b/src/electron/ipc-api/dnd.js | |||
@@ -1,16 +1,23 @@ | |||
1 | import { ipcMain } from 'electron'; | 1 | import { ipcMain } from 'electron'; |
2 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 2 | import { getDoNotDisturb } from 'macos-notification-state'; |
3 | import { isMac } from '../../environment'; | ||
3 | 4 | ||
4 | const debug = require('debug')('Ferdi:ipcApi:dnd'); | 5 | const debug = require('debug')('Ferdi:ipcApi:dnd'); |
5 | 6 | ||
6 | export default async () => { | 7 | export default async () => { |
7 | ipcMain.handle('get-dnd', async () => { | 8 | ipcMain.handle('get-dnd', async () => { |
9 | if (!isMac) { | ||
10 | debug('Not on macOS, returning', false); | ||
11 | return false; | ||
12 | } | ||
13 | |||
8 | try { | 14 | try { |
9 | const isDND = getDoNotDisturb(); | 15 | const isDND = getDoNotDisturb(); |
10 | debug('Fetching DND state, set to', isDND); | 16 | debug('Fetching DND state, set to', isDND); |
11 | return isDND; | 17 | return isDND; |
12 | } catch (e) { | 18 | } catch (e) { |
13 | console.error(e); | 19 | console.error(e); |
20 | return false; | ||
14 | } | 21 | } |
15 | }); | 22 | }); |
16 | }; | 23 | }; |