Refactoring
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user