diff --git a/web/components/core/views/calendar-view/calendar.tsx b/web/components/core/views/calendar-view/calendar.tsx index db7d7dc84..839aaba93 100644 --- a/web/components/core/views/calendar-view/calendar.tsx +++ b/web/components/core/views/calendar-view/calendar.tsx @@ -60,7 +60,7 @@ export const CalendarView: React.FC = ({ 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, @@ -160,12 +160,13 @@ export const CalendarView: React.FC = ({ }; 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;