diff options
Diffstat (limited to 'src/electron/ipc-api/dnd.js')
-rw-r--r-- | src/electron/ipc-api/dnd.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/electron/ipc-api/dnd.js b/src/electron/ipc-api/dnd.js new file mode 100644 index 000000000..4589aa222 --- /dev/null +++ b/src/electron/ipc-api/dnd.js | |||
@@ -0,0 +1,16 @@ | |||
1 | import { ipcMain } from 'electron'; | ||
2 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | ||
3 | |||
4 | const debug = require('debug')('Franz:ipcApi:dnd'); | ||
5 | |||
6 | export default async () => { | ||
7 | ipcMain.handle('get-dnd', async () => { | ||
8 | try { | ||
9 | const isDND = getDoNotDisturb(); | ||
10 | debug('Fetching DND state, set to', isDND); | ||
11 | return isDND; | ||
12 | } catch (e) { | ||
13 | console.error(e); | ||
14 | } | ||
15 | }); | ||
16 | }; | ||