Browse Source

fix upgrade ui logic

pull/16/head
Jonathan Cobb 4 years ago
parent
commit
a2e85d68e0
2 changed files with 10 additions and 10 deletions
  1. +3
    -2
      src/_store/system.module.js
  2. +7
    -8
      src/account/NetworkPage.vue

+ 3
- 2
src/_store/system.module.js View File

@@ -162,14 +162,14 @@ const actions = {
)
},
checkForUpgrade({ commit }) {
if (this.state.upgradeCheck === null) {
if (state.upgradeCheck === null) {
commit('checkForUpgradeRequest');
systemService.checkForUpgrade().then(
configs => commit('checkForUpgradeSuccess', configs),
error => commit('checkForUpgradeFailure', error)
);
} else {
console.log('checkForUpgrade: already checked, not checking again');
console.log('checkForUpgrade: already checked ('+state.upgradeCheck+'), not checking again');
}
},
upgrade({ commit }) {
@@ -442,6 +442,7 @@ const mutations = {

checkForUpgradeRequest(state) {},
checkForUpgradeSuccess(state, ok) {
console.log('checkForUpgradeSuccess: ok');
state.upgradeCheck = true;
},
checkForUpgradeFailure(state, error) {


+ 7
- 8
src/account/NetworkPage.vue View File

@@ -48,12 +48,12 @@

<div v-if="isSelfNetAndRunning">

<div v-if="user.admin === true && configs && configs.jarVersion && configs.jarUpgradeAvailable && configs.jarUpgradeAvailable.version">
<div v-if="user.admin === true && checkingForUpgrade !== null && configs && configs.jarVersion && configs.jarUpgradeAvailable && configs.jarUpgradeAvailable.version">
<hr/>
<h4>{{messages.message_jar_upgrade_available}}</h4>
<p>
{{messages.message_jar_upgrade_version}} {{configs.jarUpgradeAvailable.version}}<br/>
{{messages.message_jar_current_version}} {{configs.jarVersion}}
{{messages.message_jar_current_version}} <b>{{configs.jarVersion}}</b><br/>
{{messages.message_jar_upgrade_version}} <b>{{configs.jarUpgradeAvailable.version}}</b>
</p>
<button v-if="!upgrading" :disabled="upgrading" @click="doUpgrade()">{{messages.button_label_jar_upgrade}}</button>
<button v-else-if="upgrading" :disabled="true">{{messages.button_label_jar_upgrading}}</button>
@@ -62,7 +62,7 @@
</div>
<div v-else-if="user.admin === true && configs && configs.jarVersion">
<hr/>
<h6>{{messages.message_jar_current_version}} {{configs.jarVersion}}</h6>
<h6>{{messages.message_jar_current_version}} <b>{{configs.jarVersion}}</b></h6>
<p v-if="checkingForUpgrade">{{messages.message_jar_checking_for_upgrade}}</p>
<hr/>
</div>
@@ -181,7 +181,7 @@
restoreKeyCode: null,
restoreKeyPassword: null,
loadingImgSrc: loadingImgSrc,
checkingForUpgrade: false,
checkingForUpgrade: null,
upgradeRefresher: null
};
},
@@ -421,12 +421,10 @@
// window.clearInterval(this.upgradeRefresher);
}

} else if (c.jarVersion && c.jarUpgradeAvailable === null) {
} else if (c.jarVersion) {
this.checkingForUpgrade = true;
console.log('watch.configs: checking for upgrade...')
this.checkForUpgrade();
} else {
console.log('watch.config: no need to check for upgrade, sage version info already present');
}
} else {
console.log('watch.configs: user is not admin, not checking for upgrade');
@@ -453,6 +451,7 @@
window.setTimeout(() => {
console.log('reloading system configs in response to upgrade check')
vue.loadSystemConfigs();
this.checkingForUpgrade = false;
}, 10000);
}
}


Loading…
Cancel
Save