forked from github/plane
fix: calendar issues display filters loop fix (#2167)
This commit is contained in:
parent
a34b0b059d
commit
4ce01ca4f8
@ -60,7 +60,7 @@ export const CalendarView: React.FC<Props> = ({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId, cycleId, moduleId, viewId } = router.query;
|
const { workspaceSlug, projectId, cycleId, moduleId, viewId } = router.query;
|
||||||
|
|
||||||
const { calendarIssues, params, setDisplayFilters } = useCalendarIssuesView();
|
const { calendarIssues, params, displayFilters, setDisplayFilters } = useCalendarIssuesView();
|
||||||
|
|
||||||
const totalDate = eachDayOfInterval({
|
const totalDate = eachDayOfInterval({
|
||||||
start: calendarDates.startDate,
|
start: calendarDates.startDate,
|
||||||
@ -160,12 +160,13 @@ export const CalendarView: React.FC<Props> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!displayFilters || displayFilters.calendar_date_range === "")
|
||||||
setDisplayFilters({
|
setDisplayFilters({
|
||||||
calendar_date_range: `${renderDateFormat(startOfWeek(currentDate))};after,${renderDateFormat(
|
calendar_date_range: `${renderDateFormat(
|
||||||
lastDayOfWeek(currentDate)
|
startOfWeek(currentDate)
|
||||||
)};before`,
|
)};after,${renderDateFormat(lastDayOfWeek(currentDate))};before`,
|
||||||
});
|
});
|
||||||
}, [currentDate, setDisplayFilters]);
|
}, [currentDate, displayFilters, setDisplayFilters]);
|
||||||
|
|
||||||
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disableUserActions;
|
const isNotAllowed = userAuth.isGuest || userAuth.isViewer || disableUserActions;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user