diff --git a/dashboard/src/components/app/Updates.vue b/dashboard/src/components/app/Updates.vue index af208a899..6fead8398 100644 --- a/dashboard/src/components/app/Updates.vue +++ b/dashboard/src/components/app/Updates.vue @@ -19,11 +19,21 @@ const profile = ref({}); const busyUpdate = ref(false); const busyCheck = ref(false); const skipBackup = ref(false); +const updateError = ref(''); const autoUpdatesEnabled = ref(false); -watch(autoUpdatesEnabled, async (newValue) => { - const [error] = await appsModel.configure(props.app.id, 'automatic_update', { enable: newValue }); - if (error) return console.error(error); -}); +const autoUpdatesEnabledBusy = ref(false); + +async function onAutoUpdatesEnabledChange(value) { + autoUpdatesEnabledBusy.value = true; + + const [error] = await appsModel.configure(props.app.id, 'automatic_update', { enable: value }); + if (error) { + autoUpdatesEnabled.value = !value; + console.error(error); + } + + autoUpdatesEnabledBusy.value = false; +} async function refreshUpdates() { const [error, result] = await updaterModel.info(); @@ -50,15 +60,21 @@ async function onCheck() { async function onUpdate() { busyUpdate.value = true; - const [error] = await appsModel.update(props.app.id, update.value.manifest, skipBackup.value); + updateError.value = ''; + + let [error] = await appsModel.update(props.app.id, update.value.manifest, skipBackup.value); if (error) { busyUpdate.value = false; + if (error.status === 400) updateError.value = error.body ? error.body.message : 'Internal error'; return console.error(error); } - await refreshUpdates(); + update.value = null; dialog.value.close(); + + [error] = await appsModel.checkForUpdates(props.app.id); + if (error) return console.error(error); } function onAskUpdate() { @@ -99,13 +115,12 @@ onMounted(async () => { @alternate="onSetupSubscription()" >
+
{{ $t('app.updateDialog.subscriptionExpired') }}
+
{{ updateError }}
+

{{ $t('app.updateDialog.unstableWarning') }}

{{ $t('app.updateDialog.changelogHeader', { version: update.manifest.version }) }}

-

-
- {{ $t('app.updateDialog.subscriptionExpired') }} -

@@ -116,7 +131,7 @@ onMounted(async () => {

{{ $t('app.updates.info.customAppUpdateInfo') }}

- +