BugFix: cancel button on LocationEditForm did not work when adding new
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user