From 3c94723b231ab85cc5e16126e5bea23b0f6f712b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 10 Nov 2022 15:43:28 +0100 Subject: [PATCH] fix: show rollback button loading --- apps/ui/src/routes/settings/coolify.svelte | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/apps/ui/src/routes/settings/coolify.svelte b/apps/ui/src/routes/settings/coolify.svelte index 857a4aa63..26382641b 100644 --- a/apps/ui/src/routes/settings/coolify.svelte +++ b/apps/ui/src/routes/settings/coolify.svelte @@ -46,7 +46,8 @@ save: false, remove: false, proxyMigration: false, - restart: false + restart: false, + rollback: false }; let rollbackVersion = localStorage.getItem('lastVersion'); @@ -55,14 +56,20 @@ const sure = confirm(`Are you sure you want rollback Coolify to ${rollbackVersion}?`); if (sure) { try { + loading.rollback = true; + console.log('loading.rollback', loading.rollback); if (dev) { console.log('rolling back to', rollbackVersion); await asyncSleep(4000); return window.location.reload(); } else { + addToast({ + message: 'Rollback started...', + type: 'success' + }); await post(`/update`, { type: 'update', latestVersion: rollbackVersion }); addToast({ - message: 'Update completed.

Waiting for the new version to start...', + message: 'Rollback completed.

Waiting for the new version to start...', type: 'success' }); @@ -89,7 +96,7 @@ } catch (error) { return errorNotification(error); } finally { - loading.remove = false; + loading.rollback = false; } } } @@ -374,8 +381,11 @@ name="rollbackVersion" id="rollbackVersion" /> - Rollback