VC runtime detection changes

This commit is contained in:
2020-04-13 11:26:27 -05:00
parent 474e27eda3
commit c5b2bd44ec
3 changed files with 124 additions and 39 deletions

View File

@@ -12,6 +12,7 @@ import {downloadItem} from '../../redux/actions/download_actions';
const mapStateToProps = state => {
return {
AllowMount: state.common.AllowMount,
AppPlatform: state.common.AppPlatform,
DismissDependencies: state.install.DismissDependencies,
DownloadActive: state.download.DownloadActive,
@@ -35,6 +36,12 @@ const mapDispatchToProps = dispatch => {
};
export default connect(mapStateToProps, mapDispatchToProps)(props => {
const getSelectedVersion = () => {
return (props.ReleaseVersion === -1) ?
'unavailable' :
props.VersionLookup[Constants.RELEASE_TYPES[props.Release]][props.ReleaseVersion];
};
const handleDownloadRelease = () => {
const fileName = props.version + '.zip';
props.downloadItem(fileName, Constants.INSTALL_TYPES.Release, props.LocationsLookup[props.version].urls);
@@ -52,7 +59,10 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
};
const text = props.InstalledVersion + ' [' + props.AppPlatform + ']';
const disabled = props.DownloadActive || props.InstallActive || props.MountsBusy;
const disabled = props.DownloadActive ||
props.InstallActive ||
props.MountsBusy ||
(!props.AllowMount && (getSelectedVersion() !== 'unavailable')) ;
const releaseExtracting = (props.InstallType === Constants.INSTALL_TYPES.Release);
let optionsDisplay = [];