Refactoring

This commit is contained in:
Scott E. Graves
2019-07-15 14:54:28 -05:00
parent d7759402f6
commit f006beb8d9
14 changed files with 261 additions and 355 deletions

View File

@@ -71,6 +71,17 @@ function setWindowVisibility(show) {
}
}
const unmountAllDrives = () => {
// Unmount all items
for (const i in mountedLocations) {
const data = mountedData[mountedLocations[i]];
helpers.stopMountProcessSync(data.Version, data.Provider);
}
mountedLocations = [];
mountedData = {};
};
function createWindow() {
loadUiSettings();
@@ -123,14 +134,7 @@ function createWindow() {
// when you should delete the corresponding element.
mainWindow = null;
// Unmount all items
for (const i in mountedLocations) {
const data = mountedData[mountedLocations[i]];
helpers.stopMountProcessSync(data.Version, data.Provider);
}
mountedLocations = [];
mountedData = {};
unmountAllDrives();
});
const appPath = (os.platform() === 'win32') ? path.resolve(path.join(app.getAppPath(), '..\\..\\repertory-ui.exe')) :
@@ -717,6 +721,8 @@ ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
let allowSkipVerification = true;
unmountAllDrives();
let tempSig;
let tempPub;
const cleanupFiles = () => {