#29: Mounts aren't being detected properly when switching releases

This commit is contained in:
Scott E. Graves
2019-07-16 14:10:32 -05:00
parent 8eda25a2a7
commit fc5b9e0a86
5 changed files with 27 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ import Modal from '../../components/UI/Modal/Modal';
import MountItem from '../../components/MountItem/MountItem';
import IPCContainer from '../IPCContainer/IPCContainer';
import {
resetMountsState,
setAllowMount,
setAutoMountProcessed,
setBusy,
@@ -19,14 +20,6 @@ import {notifyError} from '../../redux/actions/error_actions';
const Constants = require('../../constants');
class MountItems extends IPCContainer {
constructor(props) {
super(props);
this.setRequestHandler(Constants.IPC_Detect_Mounts_Reply, this.onDetectMountsReply);
this.setRequestHandler(Constants.IPC_Mount_Drive_Reply, this.onMountDriveReply);
this.setRequestHandler(Constants.IPC_Unmount_Drive_Reply, this.onUnmountDriveReply);
}
retryIntervals = {};
state = {
@@ -56,6 +49,10 @@ class MountItems extends IPCContainer {
};
componentDidMount() {
this.setRequestHandler(Constants.IPC_Detect_Mounts_Reply, this.onDetectMountsReply);
this.setRequestHandler(Constants.IPC_Mount_Drive_Reply, this.onMountDriveReply);
this.setRequestHandler(Constants.IPC_Unmount_Drive_Reply, this.onUnmountDriveReply);
this.props.resetMountsState();
this.detectMounts();
}
@@ -66,6 +63,7 @@ class MountItems extends IPCContainer {
}
}
this.props.resetMountsState();
super.componentWillUnmount();
};
@@ -318,6 +316,7 @@ const mapStateToProps = state => {
AutoMountProcessed: state.mounts.AutoMountProcessed,
InstalledVersion: state.relver.InstalledVersion,
MountState: state.mounts.MountState,
MountsBusy: state.mounts.MountsBusy,
Platform: state.common.Platform,
ProviderState: state.mounts.ProviderState,
}
@@ -326,6 +325,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => {
return {
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
resetMountsState: () => dispatch(resetMountsState()),
setAllowMount: (provider, allow) => dispatch(setAllowMount(provider, allow)),
setAutoMountProcessed: processed => dispatch(setAutoMountProcessed(processed)),
setMounted: (provider, mounted) => dispatch(setMounted(provider, mounted)),