Use AppPlatform for releases

This commit is contained in:
Scott E. Graves
2019-06-05 17:33:31 -05:00
parent 8d33d756e7
commit b655310298

View File

@@ -276,8 +276,8 @@ class App extends IPCContainer {
installUpgrade = data => {
if (data.Success) {
const sha256 = this.state.LocationsLookup[this.props.Platform][this.state.VersionLookup[this.props.Platform][0]].sha256;
const signature = this.state.LocationsLookup[this.props.Platform][this.state.VersionLookup[this.props.Platform][0]].sig;
const sha256 = this.state.LocationsLookup[this.props.AppPlatform][this.state.VersionLookup[this.props.AppPlatform][0]].sha256;
const signature = this.state.LocationsLookup[this.props.AppPlatform][this.state.VersionLookup[this.props.AppPlatform][0]].sig;
this.sendRequest(Constants.IPC_Install_Upgrade, {
Sha256: sha256,
Signature: signature,
@@ -408,13 +408,13 @@ class App extends IPCContainer {
.get(Constants.RELEASES_URL)
.then(response => {
const versionLookup = {
Alpha: response.data.Versions.Alpha[this.props.Platform],
Beta: response.data.Versions.Beta[this.props.Platform],
RC: response.data.Versions.RC[this.props.Platform],
Release: response.data.Versions.Release[this.props.Platform],
Alpha: response.data.Versions.Alpha[this.props.AppPlatform],
Beta: response.data.Versions.Beta[this.props.AppPlatform],
RC: response.data.Versions.RC[this.props.AppPlatform],
Release: response.data.Versions.Release[this.props.AppPlatform],
};
const locationsLookup = {
...response.data.Locations[this.props.Platform],
...response.data.Locations[this.props.AppPlatform],
};
window.localStorage.setItem('releases', JSON.stringify({
@@ -443,13 +443,13 @@ class App extends IPCContainer {
.then(response => {
const data = response.data;
if (data.Versions &&
data.Versions[this.props.Platform] &&
(data.Versions[this.props.Platform].length > 0) &&
(data.Versions[this.props.Platform][0] !== this.props.version)) {
data.Versions[this.props.AppPlatform] &&
(data.Versions[this.props.AppPlatform].length > 0) &&
(data.Versions[this.props.AppPlatform][0] !== this.props.version)) {
this.setState({
UpgradeAvailable: true,
UpgradeDismissed: false,
UpgradeData: data.Locations[this.props.Platform][data.Versions[this.props.Platform][0]],
UpgradeData: data.Locations[this.props.AppPlatform][data.Versions[this.props.AppPlatform][0]],
});
}
}).catch(() => {
@@ -720,6 +720,7 @@ class App extends IPCContainer {
const mapStateToProps = state => {
return {
AppPlatform: state.common.AppPlatform,
DisplayConfiguration: state.mounts.DisplayConfiguration,
MountsBusy: state.mounts.MountsBusy,
Platform: state.common.Platform,