From 64325150d5cc703d667fe6ed6b4bd4ccaf6c2a0c Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Mon, 27 Nov 2023 08:10:29 +0100 Subject: [PATCH] fix(app-status): rely on server status after update --- .../components/AppDetailsContainer/AppDetailsContainer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/(dashboard)/app-store/[id]/components/AppDetailsContainer/AppDetailsContainer.tsx b/src/app/(dashboard)/app-store/[id]/components/AppDetailsContainer/AppDetailsContainer.tsx index 8b95b939..ba6526c9 100644 --- a/src/app/(dashboard)/app-store/[id]/components/AppDetailsContainer/AppDetailsContainer.tsx +++ b/src/app/(dashboard)/app-store/[id]/components/AppDetailsContainer/AppDetailsContainer.tsx @@ -94,11 +94,11 @@ export const AppDetailsContainer: React.FC = ({ app, localDomain }) => { const updateMutation = useAction(updateAppAction, { onSuccess: (data) => { + setCustomStatus(app.status); + if (!data.success) { - setCustomStatus(app.status); toast.error(data.failure.reason); } else { - setCustomStatus('stopped'); toast.success(t('apps.app-details.update-success')); } },