Improved mount state detection

This commit is contained in:
2019-11-25 13:14:34 -06:00
parent 2a541c8a9a
commit af68d20d42
3 changed files with 19 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
# Changelog
## 1.1.1
* \#43: Support for remote UNIX mounts
* Improved mount state detection
## 1.1.0
* \#40: Support for remote Windows mounts

View File

@@ -228,20 +228,23 @@ class MountItems extends IPCContainer {
};
onDetectMountReply = (event, arg) => {
if (!this.state.DisplayRetry && arg.data.Success) {
const provider = arg.data.Provider;
if (!this.state.RetryItems[provider]) {
if (arg.data.Success && (!arg.data.Active || (arg.data.Location && (arg.data.Location.length > 0)))) {
const mountState = {
AllowMount: true,
DriveLetters: (arg.data.DriveLetters),
Mounted: (arg.data.Location.length > 0),
DriveLetters: arg.data.DriveLetters,
Mounted: arg.data.Active,
};
this.props.setMountState(provider, mountState);
this.updateMountLocation(provider, arg.data.Location, mountState.Mounted, arg.data.DriveLetters);
this.props.setAutoMountProcessed(provider,true);
this.props.setAutoMountProcessed(provider, true);
this.removeMountsBusy(provider);
} else {
this.props.notifyError(arg.data.Error);
this.detectMount(provider);
this.removeMountsBusy(provider);
}
}
};

View File

@@ -177,8 +177,10 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
firstMountCheck = false;
}
standardIPCReply(event, Constants.IPC_Detect_Mount_Reply, {
Active: storageData[provider].Active,
DriveLetters: driveLetters[provider],
Location: locations[provider],
PID: storageData[provider].PID,
Provider: provider,
});
})