forms: gotoHome activating previously active month
This commit is contained in:
@@ -19,7 +19,7 @@ export const BillDeleteForm:FC<BillDeleteFormProps> = ({ bill, location }) =>
|
|||||||
const [ state, dispatch ] = useFormState(handleAction, null);
|
const [ state, dispatch ] = useFormState(handleAction, null);
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
gotoHome(`/?year=${location.yearMonth.year}`);
|
gotoHome(`/?year=${location.yearMonth.year}&month=${location.yearMonth.month}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const BillEditForm:FC<BillEditFormProps> = ({ location, bill }) => {
|
|||||||
|
|
||||||
// redirect to the main page
|
// redirect to the main page
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
gotoHome(billYear ? `/?year=${billYear}` : undefined);
|
gotoHome(billYear ? `/?year=${billYear}&month=${location.yearMonth.month}` : undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
const billPaid_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const billPaid_handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ export const LocationEditForm:FC<LocationEditFormProps> = ({ location, yearMonth
|
|||||||
|
|
||||||
// redirect to the main page
|
// redirect to the main page
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
console.log('handleCancel');
|
gotoHome(location ? `/?year=${location?.yearMonth?.year}&month=${location?.yearMonth?.month}` : undefined);
|
||||||
gotoHome(location ? `/?year=${location?.yearMonth?.year}` : undefined);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|||||||
Reference in New Issue
Block a user