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(