From 9f2277735764c07929e4b9e6fa5a11ae916bb2c6 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Fri, 13 Aug 2021 08:05:12 +0530 Subject: chore: Replace old '@meetfranz/electron-notification-state' with 'macos-notification-state' --- src/electron/ipc-api/dnd.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/electron') 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 @@ import { ipcMain } from 'electron'; -import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; +import { getDoNotDisturb } from 'macos-notification-state'; +import { isMac } from '../../environment'; const debug = require('debug')('Ferdi:ipcApi:dnd'); export default async () => { ipcMain.handle('get-dnd', async () => { + if (!isMac) { + debug('Not on macOS, returning', false); + return false; + } + try { const isDND = getDoNotDisturb(); debug('Fetching DND state, set to', isDND); return isDND; } catch (e) { console.error(e); + return false; } }); }; -- cgit v1.2.3-54-g00ecf