aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/ipc-api/dnd.js
blob: da4d7781e6478b2916ac3fa145a2bf696139be69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { ipcMain } from 'electron';
import { getDoNotDisturb } from '@meetfranz/electron-notification-state';

const debug = require('debug')('Ferdi:ipcApi:dnd');

export default async () => {
  ipcMain.handle('get-dnd', async () => {
    try {
      const isDND = getDoNotDisturb();
      debug('Fetching DND state, set to', isDND);
      return isDND;
    } catch (e) {
      console.error(e);
    }
  });
};