#36: Add ability to select Linux distribution type if OS is unsupported - partial
This commit is contained in:
23
src/App.js
23
src/App.js
@@ -14,7 +14,11 @@ import MountItems from './containers/MountItems/MountItems';
|
||||
import {notifyError} from './redux/actions/error_actions';
|
||||
import Reboot from './components/Reboot/Reboot';
|
||||
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
|
||||
import {saveState} from './redux/actions/common_actions';
|
||||
import {
|
||||
displaySelectAppPlatform,
|
||||
saveState
|
||||
} from './redux/actions/common_actions';
|
||||
import SelectAppPlatform from './components/SelectAppPlatform/SelectAppPlatform';
|
||||
import Text from './components/UI/Text/Text';
|
||||
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
|
||||
import UpgradeUI from './components/UpgradeUI/UpgradeUI';
|
||||
@@ -30,7 +34,11 @@ class App extends IPCContainer {
|
||||
componentDidMount() {
|
||||
const detectUpgrades = () => {
|
||||
if (this.props.AppPlatform === 'unknown') {
|
||||
this.props.notifyError('Operating system is not supported.', true);
|
||||
if (this.props.Platform === 'linux') {
|
||||
this.props.displaySelectAppPlatform(true);
|
||||
} else {
|
||||
this.props.notifyError('Operating system is not supported.', true);
|
||||
}
|
||||
} else {
|
||||
this.props.loadReleases();
|
||||
}
|
||||
@@ -119,9 +127,12 @@ class App extends IPCContainer {
|
||||
const downloadDisplay = this.createModalConditionally(this.props.DownloadActive, <DownloadProgress/>);
|
||||
const errorDisplay = this.createModalConditionally(this.props.DisplayError, <ErrorDetails/>, true);
|
||||
const upgradeDisplay = this.createModalConditionally(showUpgrade, <UpgradeUI/>);
|
||||
const selectAppPlatformDisplay = this.createModalConditionally(this.props.DisplaySelectAppPlatform, <SelectAppPlatform/>);
|
||||
|
||||
let mainContent = [];
|
||||
if (this.props.AppReady) {
|
||||
if (this.props.DisplaySelectAppPlatform || !this.props.AppReady) {
|
||||
mainContent = <Loading/>
|
||||
} else {
|
||||
let key = 0;
|
||||
mainContent.push((
|
||||
<div key={'rvd_' + key++}
|
||||
@@ -140,12 +151,11 @@ class App extends IPCContainer {
|
||||
</div>
|
||||
));
|
||||
}
|
||||
} else {
|
||||
mainContent = <Loading/>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={'App'}>
|
||||
{selectAppPlatformDisplay}
|
||||
{errorDisplay}
|
||||
{dependencyDisplay}
|
||||
{upgradeDisplay}
|
||||
@@ -193,12 +203,14 @@ const mapStateToProps = state => {
|
||||
DismissDependencies: state.install.DismissDependencies,
|
||||
DisplayConfiguration: state.mounts.DisplayConfiguration,
|
||||
DisplayError: state.error.DisplayError,
|
||||
DisplaySelectAppPlatform: state.common.DisplaySelectAppPlatform,
|
||||
DownloadActive: state.download.DownloadActive,
|
||||
InstallActive: state.install.InstallActive,
|
||||
InstalledVersion: state.relver.InstalledVersion,
|
||||
LocationsLookup: state.relver.LocationsLookup,
|
||||
MissingDependencies: state.install.MissingDependencies,
|
||||
MountsBusy: state.mounts.MountsBusy,
|
||||
Platform: state.common.Platform,
|
||||
ProviderState: state.mounts.ProviderState,
|
||||
RebootRequired: state.common.RebootRequired,
|
||||
Release: state.relver.Release,
|
||||
@@ -212,6 +224,7 @@ const mapStateToProps = state => {
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
displaySelectAppPlatform: ()=> dispatch(displaySelectAppPlatform()),
|
||||
loadReleases: ()=> dispatch(loadReleases()),
|
||||
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
|
||||
saveState: () => dispatch(saveState()),
|
||||
|
||||
Reference in New Issue
Block a user