Handle release unavailable

This commit is contained in:
Scott E. Graves
2019-07-24 14:09:11 -05:00
parent 763bf4491d
commit 37607bf152
5 changed files with 56 additions and 9 deletions

View File

@@ -72,6 +72,12 @@ function setWindowVisibility(show) {
}
const unmountAllDrives = () => {
// Reset mount states
for (const provider of Constants.PROVIDER_LIST) {
clearManualMountDetection(provider);
expectedUnmount[provider] = true;
}
// Unmount all items
for (const i in mountedLocations) {
const data = mountedData[mountedLocations[i]];
@@ -898,16 +904,21 @@ ipcMain.on(Constants.IPC_Show_Window + '_sync', event => {
event.returnValue = true;
});
ipcMain.on(Constants.IPC_Unmount_All_Drives, (event, data) => {
unmountAllDrives();
standardIPCReply(event, Constants.IPC_Unmount_All_Drives_Reply);
});
ipcMain.on(Constants.IPC_Unmount_Drive, (event, data) => {
clearManualMountDetection(data.Provider);
expectedUnmount[data.Provider] = true;
helpers
.stopMountProcess(data.Version, data.Provider)
.then((result)=> {
.then(result => {
console.log(result);
})
.catch((e) => {
.catch(e => {
console.log(e);
});
});