diff options
author | 2021-08-13 08:05:12 +0530 | |
---|---|---|
committer | 2021-08-13 07:32:56 +0000 | |
commit | 9f2277735764c07929e4b9e6fa5a11ae916bb2c6 (patch) | |
tree | 957f40672bb090cc765237a17a15f6408f12cdbf /src/electron/ipc-api/dnd.js | |
parent | chore: Add entitlements for screen-capture-permissions (diff) | |
download | ferdium-app-9f2277735764c07929e4b9e6fa5a11ae916bb2c6.tar.gz ferdium-app-9f2277735764c07929e4b9e6fa5a11ae916bb2c6.tar.zst ferdium-app-9f2277735764c07929e4b9e6fa5a11ae916bb2c6.zip |
chore: Replace old '@meetfranz/electron-notification-state' with 'macos-notification-state'
Diffstat (limited to 'src/electron/ipc-api/dnd.js')
-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 | }; |