From 56ff17853a5a82cd368bf34acf8809ab652b833e Mon Sep 17 00:00:00 2001 From: Ravinou Date: Sun, 20 Apr 2025 22:53:40 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=9A=A1=20improves=20repo=20delet?= =?UTF-8?q?ion=20error=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Containers/RepoManage/RepoManage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Containers/RepoManage/RepoManage.tsx b/Containers/RepoManage/RepoManage.tsx index fb17ae4..6ee7407 100644 --- a/Containers/RepoManage/RepoManage.tsx +++ b/Containers/RepoManage/RepoManage.tsx @@ -86,12 +86,14 @@ export default function RepoManage(props: RepoManageProps) { ); router.replace('/'); } else { - if (response.status == 403) + if (response.status == 403) { toast.warning( '🔒 The server is currently protected against repository deletion.', toastOptions ); - else { + setIsLoading(false); + router.replace('/'); + } else { const errorMessage = await response.json(); toast.error(`An error has occurred : ${errorMessage.message.stderr}`, toastOptions); router.replace('/');