From a1d1db2a0cab28188de3d3a07bc9ab2e5d06e8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Fri, 2 Feb 2024 10:25:21 +0100 Subject: [PATCH] BugFix: cancel button on LocationEditForm did not work when adding new --- app/ui/LocationEditForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx index 7c3b8b9..97b5c49 100644 --- a/app/ui/LocationEditForm.tsx +++ b/app/ui/LocationEditForm.tsx @@ -24,7 +24,11 @@ export const LocationEditForm:FC = ({ location, yearMonth // redirect to the main page const handleCancel = () => { - if(location) gotoHome(location?.yearMonth); + if(location) + gotoHome(location?.yearMonth); + else if(yearMonth) + gotoHome(yearMonth); + }; return(