BugFix: cancel button on LocationEditForm did not work when adding new

This commit is contained in:
2024-02-02 10:25:21 +01:00
parent 7dcc232447
commit a1d1db2a0c

View File

@@ -24,7 +24,11 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ 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(