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,16 @@
const Constants = require('../../constants');
const os = require('os');
const helpers = require('../../helpers');
const addListeners = (ipcMain, closeApplication) => {
ipcMain.on(Constants.IPC_Reboot_System, () => {
if (os.platform() === 'win32') {
helpers.executeAsync('shutdown.exe', ['/r', '/t', '30']);
}
closeApplication();
});
};
module.exports = {
addListeners
};