const Constants = require('../../constants');

const addListeners = (ipcMain, {closeApplication, setWindowVisibility}) => {
  ipcMain.on(Constants.IPC_Shutdown, () => {
    closeApplication();
  });

  ipcMain.on(Constants.IPC_Show_Window, () => {
    setWindowVisibility(true);
  });

  ipcMain.on(Constants.IPC_Show_Window + '_sync', event => {
    setWindowVisibility(true);
    event.returnValue = true;
  });
};

module.exports = {
  addListeners
};
