Display any update check error
This commit is contained in:
@@ -60,6 +60,7 @@ const currentPattern = ref('');
|
||||
const updateBusy = ref(false);
|
||||
const updateError = ref({});
|
||||
const stopError = ref({});
|
||||
const updateCheckError = ref({});
|
||||
const checkingBusy = ref(false);
|
||||
const pendingUpdate = ref(null);
|
||||
const skipBackup = ref(false);
|
||||
@@ -108,6 +109,7 @@ async function refreshInfo() {
|
||||
|
||||
updateError.value = {};
|
||||
stopError.value = {};
|
||||
updateCheckError.value = {};
|
||||
|
||||
pendingUpdate.value = result || null;
|
||||
}
|
||||
@@ -218,9 +220,14 @@ async function onSubmitUpdate() {
|
||||
|
||||
async function onCheck() {
|
||||
checkingBusy.value = true;
|
||||
updateCheckError.value = {};
|
||||
|
||||
const [error] = await updaterModel.checkBoxUpdate();
|
||||
if (error) return console.error(error);
|
||||
if (error) {
|
||||
updateCheckError.value.generic = error.body?.message || 'Internal error';
|
||||
checkingBusy.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
await refreshInfo();
|
||||
checkingBusy.value = false;
|
||||
@@ -336,6 +343,7 @@ onMounted(async () => {
|
||||
<p v-if="updateBusy && lastTask">{{ lastTask.message }}</p>
|
||||
|
||||
<div class="error-label" v-if="stopError.generic">{{ stopError.generic }}</div>
|
||||
<div class="error-label" v-if="updateCheckError.generic">{{ updateCheckError.generic }}</div>
|
||||
|
||||
<div class="button-bar">
|
||||
<Button danger v-if="updateBusy" @click="onStop()">{{ $t('settings.updates.stopUpdateAction') }}</Button>
|
||||
|
||||
Reference in New Issue
Block a user