aboutsummaryrefslogtreecommitdiffstats
path: root/src/electron/ipc-api/dnd.js
blob: 4589aa222f99d6138a847a7f2fd60d8ecfb38791 (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')('Franz: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);
    }
  });
};