From 7cfd313531848f8fedc6ac48381e8c7623afafb7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 7 Sep 2022 09:45:16 +0200 Subject: [PATCH] ui: fix loading start/stop db/services --- apps/ui/src/routes/databases/[id]/__layout.svelte | 3 +++ apps/ui/src/routes/services/[id]/__layout.svelte | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/routes/databases/[id]/__layout.svelte b/apps/ui/src/routes/databases/[id]/__layout.svelte index 315ab8471..26f8bd9e7 100644 --- a/apps/ui/src/routes/databases/[id]/__layout.svelte +++ b/apps/ui/src/routes/databases/[id]/__layout.svelte @@ -87,12 +87,15 @@ const sure = confirm($t('database.confirm_stop', { name: database.name })); if (sure) { $status.database.initialLoading = true; + $status.database.loading = true; try { await post(`/databases/${database.id}/stop`, {}); } catch (error) { return errorNotification(error); } finally { $status.database.initialLoading = false; + $status.database.loading = false; + await getStatus(); } } } diff --git a/apps/ui/src/routes/services/[id]/__layout.svelte b/apps/ui/src/routes/services/[id]/__layout.svelte index 7304315fe..c7a293cfd 100644 --- a/apps/ui/src/routes/services/[id]/__layout.svelte +++ b/apps/ui/src/routes/services/[id]/__layout.svelte @@ -97,12 +97,15 @@ const sure = confirm($t('database.confirm_stop', { name: service.name })); if (sure) { $status.service.initialLoading = true; + $status.service.loading = true; try { await post(`/services/${service.id}/${service.type}/stop`, {}); } catch (error) { return errorNotification(error); } finally { $status.service.initialLoading = false; + $status.service.loading = false; + await getStatus(); } } } @@ -207,7 +210,7 @@ {/if} {#if $status.service.initialLoading}