Skip to content

Commit

Permalink
feat(plasma-new-hope): fix calendar state change
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanKuzmich committed Jul 23, 2024
1 parent da442e8 commit a5f1800
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ export const calendarBaseRoot = (Root: RootProps<HTMLDivElement, HTMLAttributes<
);

useEffect(() => {
if (prevType !== type) {
if (prevType !== calendarState) {
dispatch({
type: ActionType.UPDATE_CALENDAR_STATE,
payload: { calendarState: type, size: sizeMap[type].single },
payload: { calendarState, size: sizeMap[calendarState].single },
});

setPrevType(type);
setPrevType(calendarState);
}
}, [type]);
}, [calendarState]);

useEffect(() => {
if (!prevValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ export const calendarDoubleRoot = (Root: RootProps<HTMLDivElement, HTMLAttribute
);

useEffect(() => {
if (prevType !== type) {
if (prevType !== calendarState) {
dispatch({
type: ActionType.UPDATE_CALENDAR_STATE,
payload: { calendarState: type, size: sizeMap[type].double },
payload: { calendarState, size: sizeMap[calendarState].double },
});

setPrevType(type);
setPrevType(calendarState);
}
}, [type]);
}, [calendarState]);

useEffect(() => {
if (!prevValue) {
Expand Down

0 comments on commit a5f1800

Please sign in to comment.