Refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const Constants = require('../../constants');
|
||||
|
||||
const addListeners = (ipcMain, closeApplication, setWindowVisibility) => {
|
||||
const addListeners = (ipcMain, {closeApplication, setWindowVisibility}) => {
|
||||
ipcMain.on(Constants.IPC_Shutdown, () => {
|
||||
closeApplication();
|
||||
});
|
||||
@@ -17,4 +17,4 @@ const addListeners = (ipcMain, closeApplication, setWindowVisibility) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Constants = require('../../constants');
|
||||
const helpers = require('../../helpers');
|
||||
|
||||
const addListeners = (ipcMain, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Get_Config, (event, data) => {
|
||||
helpers
|
||||
.getConfig(data.Version, data.Provider, data.Remote)
|
||||
@@ -53,4 +53,4 @@ const addListeners = (ipcMain, standardIPCReply) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Constants = require('../../constants');
|
||||
const helpers = require('../../helpers');
|
||||
|
||||
const addListeners = (ipcMain, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Check_Daemon_Version, (event, data) => {
|
||||
helpers
|
||||
.checkDaemonVersion(data.Version, data.Provider)
|
||||
@@ -44,4 +44,4 @@ const addListeners = (ipcMain, standardIPCReply) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ const Constants = require('../../constants');
|
||||
const fs = require('fs');
|
||||
const helpers = require('../../helpers');
|
||||
|
||||
const addListeners = (ipcMain, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Check_Dependency_Installed, (event, data) => {
|
||||
try {
|
||||
const exists = fs.lstatSync(data.File).isFile();
|
||||
|
||||
@@ -2,7 +2,7 @@ const Constants = require('../../constants');
|
||||
const helpers = require('../../helpers');
|
||||
const path = require('path');
|
||||
|
||||
const addListeners = (ipcMain, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Download_File, (event, data) => {
|
||||
const destination = path.join(helpers.getDataDirectory(), data.Filename);
|
||||
helpers.downloadFile(data.URL, destination, (progress) => {
|
||||
@@ -22,4 +22,4 @@ const addListeners = (ipcMain, standardIPCReply) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Constants = require('../../constants');
|
||||
const fs = require('fs');
|
||||
|
||||
const addListeners = (ipcMain, getMainWindow, dialog) => {
|
||||
const addListeners = (ipcMain, {getMainWindow, dialog}) => {
|
||||
ipcMain.on(Constants.IPC_Browse_Directory + '_sync', (event, data) => {
|
||||
dialog.showOpenDialog(getMainWindow(), {
|
||||
defaultPath: data.Location,
|
||||
@@ -28,4 +28,4 @@ const addListeners = (ipcMain, getMainWindow, dialog) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ const unmountAllDrives = () => {
|
||||
mountedData = {};
|
||||
};
|
||||
|
||||
const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {setTrayImage, standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Check_Mount_Location + '_sync', (event, data) => {
|
||||
let response = {
|
||||
Success: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ const setPlatformOverride = platformOverride => {
|
||||
_platformOverride = platformOverride;
|
||||
};
|
||||
|
||||
const addListeners = (ipcMain, detectScript, saveUiSettings) => {
|
||||
const addListeners = (ipcMain, {detectScript, saveUiSettings}) => {
|
||||
ipcMain.on(Constants.IPC_Get_Platform, (event) => {
|
||||
const sendResponse = (appPlatform, platform) => {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
@@ -76,4 +76,4 @@ module.exports = {
|
||||
getPlatformOverride,
|
||||
setPlatformOverride,
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ const os = require('os');
|
||||
const path = require('path');
|
||||
const unzip = require('unzipper');
|
||||
|
||||
const addListeners = (ipcMain, getCleanupReleases, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {getCleanupReleases, standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Check_Installed, (event, data) => {
|
||||
const destination = path.join(helpers.getDataDirectory(), data.Version);
|
||||
helpers
|
||||
|
||||
@@ -2,7 +2,7 @@ const Constants = require('../../constants');
|
||||
const os = require('os');
|
||||
const helpers = require('../../helpers');
|
||||
|
||||
const addListeners = (ipcMain, closeApplication) => {
|
||||
const addListeners = (ipcMain, {closeApplication}) => {
|
||||
ipcMain.on(Constants.IPC_Reboot_System, () => {
|
||||
if (os.platform() === 'win32') {
|
||||
helpers.executeAsync('shutdown.exe', ['/r', '/t', '30']);
|
||||
@@ -13,4 +13,4 @@ const addListeners = (ipcMain, closeApplication) => {
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ const fs = require('fs');
|
||||
const helpers = require('../../helpers');
|
||||
const os = require('os');
|
||||
|
||||
const addListeners = (ipcMain, setIsInstalling, unmountAllDrives, standardIPCReply) => {
|
||||
const addListeners = (ipcMain, {setIsInstalling, unmountAllDrives, standardIPCReply}) => {
|
||||
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
||||
let allowSkipVerification = true;
|
||||
|
||||
@@ -113,4 +113,4 @@ const addListeners = (ipcMain, setIsInstalling, unmountAllDrives, standardIPCRep
|
||||
|
||||
module.exports = {
|
||||
addListeners
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user