Refactoring Electron IPC

This commit is contained in:
2019-08-29 16:24:05 -05:00
parent 083b2192d7
commit f8ec89413a
15 changed files with 988 additions and 836 deletions

View File

@@ -0,0 +1,20 @@
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
};