diff --git a/app/ui/LocationEditForm.tsx b/app/ui/LocationEditForm.tsx index 5dfb14c..9b4aa27 100644 --- a/app/ui/LocationEditForm.tsx +++ b/app/ui/LocationEditForm.tsx @@ -23,7 +23,7 @@ export type LocationEditFormProps = { export const LocationEditForm:FC = ({ location, yearMonth }) => { const initialState = { message: null, errors: {} }; - const handleAction = updateOrAddLocation.bind(null, location?._id, yearMonth); + const handleAction = updateOrAddLocation.bind(null, location?._id, location?.yearMonth ?? yearMonth); const [ state, dispatch ] = useFormState(handleAction, initialState); let { year, month } = location ? location.yearMonth : yearMonth;