Skip to content

Commit

Permalink
fix: calendar issues display filters loop fix (#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia committed Sep 13, 2023
1 parent a34b0b0 commit 4ce01ca
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/components/core/views/calendar-view/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const CalendarView: React.FC<Props> = ({
const router = useRouter();
const { workspaceSlug, projectId, cycleId, moduleId, viewId } = router.query;

const { calendarIssues, params, setDisplayFilters } = useCalendarIssuesView();
const { calendarIssues, params, displayFilters, setDisplayFilters } = useCalendarIssuesView();

const totalDate = eachDayOfInterval({
start: calendarDates.startDate,
Expand Down Expand Up @@ -160,12 +160,13 @@ export const CalendarView: React.FC<Props> = ({
};

useEffect(() => {
setDisplayFilters({
calendar_date_range: `${renderDateFormat(startOfWeek(currentDate))};after,${renderDateFormat(
lastDayOfWeek(currentDate)
)};before`,
});
}, [currentDate, setDisplayFilters]);
if (!displayFilters || displayFilters.calendar_date_range === "")
setDisplayFilters({
calendar_date_range: `${renderDateFormat(
startOfWeek(currentDate)
)};after,${renderDateFormat(lastDayOfWeek(currentDate))};before`,
});
}, [currentDate, displayFilters, setDisplayFilters]);

const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disableUserActions;

Expand Down

2 comments on commit 4ce01ca

@vercel
Copy link

@vercel vercel bot commented on 4ce01ca Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-sh-dev – ./space/

plane-sh-dev-plane.vercel.app
plane-sh-dev-git-develop-plane.vercel.app
plane-space-dev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 4ce01ca Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./web/

plane-dev.vercel.app
plane-dev-git-develop-plane.vercel.app
plane-dev-plane.vercel.app

Please sign in to comment.