Fix mount dropdown

This commit is contained in:
2019-10-23 15:34:09 -05:00
parent 2bf158aaa3
commit 16622ba3e8
2 changed files with 4 additions and 7 deletions

View File

@@ -67,13 +67,14 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
let inputControls = null; let inputControls = null;
if (props.Platform === 'win32') { if (props.Platform === 'win32') {
inputColumnSpan = 20; inputColumnSpan = 20;
const index = props.MState.DriveLetters.indexOf(props.PState.MountLocation);
inputControls = <DropDown changed={props.changed} inputControls = <DropDown changed={props.changed}
colSpan={inputColumnSpan} colSpan={inputColumnSpan}
disabled={!props.MState.AllowMount || props.MState.Mounted} disabled={!props.MState.AllowMount || props.MState.Mounted}
items={props.MState.DriveLetters} items={props.MState.DriveLetters}
row={secondRow} row={secondRow}
rowSpan={7} rowSpan={7}
selected={props.MState.DriveLetters.indexOf(props.PState.MountLocation)}/>; selected={index >= 0 ? props.PState.MountLocation : ''}/>;
} else { } else {
inputColumnSpan = 64; inputColumnSpan = 64;

View File

@@ -128,14 +128,10 @@ class MountItems extends IPCContainer {
} }
}; };
handleMountLocationChanged = (provider, value) => { handleMountLocationChanged = (provider, mountLocation) => {
const location = (this.props.Platform === 'win32') ?
this.props.MountState[provider].DriveLetters[value] :
value;
const state = { const state = {
...this.props.ProviderState[provider], ...this.props.ProviderState[provider],
MountLocation: location, MountLocation: mountLocation,
}; };
this.props.setProviderState(provider, state); this.props.setProviderState(provider, state);
}; };