diff --git a/client/actions/main.ts b/client/actions/main.ts index a8f0c0387..2e29e3a85 100644 --- a/client/actions/main.ts +++ b/client/actions/main.ts @@ -823,14 +823,7 @@ function _filter(filterType: PLANNING_VIEW, params: ICombinedEventOrPlanningSear if (currentFilterId != undefined || filterType === PLANNING_VIEW.COMBINED) { promise = planningApi.ui.list.changeFilterId(currentFilterId, params); } else if (filterType === PLANNING_VIEW.EVENTS) { - const calendar = urlParams.getString('calendar') || - lastParams?.calendars?.[0] || - (lastParams?.noCalendarAssigned ? - EVENTS.FILTER.NO_CALENDAR_ASSIGNED : - EVENTS.FILTER.ALL_CALENDARS - ); - - const calender = $location.search().calendar || + const calendar = $location.search().calendar || get(lastParams, 'calendars[0]', null) || (get(lastParams, 'noCalendarAssigned', false) ? {qcode: EVENTS.FILTER.NO_CALENDAR_ASSIGNED} : @@ -838,7 +831,7 @@ function _filter(filterType: PLANNING_VIEW, params: ICombinedEventOrPlanningSear ); promise = planningApi.ui.list.changeCalendarId( - calender.qcode, + calendar.qcode, params ); } else if (filterType === PLANNING_VIEW.PLANNING) {