Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32842943
D6458.1768091787.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6458.1768091787.diff
View Options
diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js
--- a/lib/reducers/calendar-filters-reducer.js
+++ b/lib/reducers/calendar-filters-reducer.js
@@ -17,6 +17,7 @@
filteredThreadIDs,
nonThreadCalendarFilters,
nonExcludeDeletedCalendarFilters,
+ nonCommunityCalendarFilters,
} from '../selectors/calendar-filter-selectors';
import { threadInFilterList } from '../shared/thread-utils';
import {
@@ -24,6 +25,8 @@
defaultCalendarFilters,
updateCalendarThreadFilter,
clearCalendarThreadFilter,
+ updateCalendarCommunityFilter,
+ clearCalendarCommunityFilter,
setCalendarDeletedFilter,
calendarThreadFilterTypes,
} from '../types/filter-types';
@@ -80,6 +83,17 @@
// Adding NOT_DELETED filter
return [...state, { type: calendarThreadFilterTypes.NOT_DELETED }];
}
+ } else if (action.type === updateCalendarCommunityFilter) {
+ const otherFilters = nonCommunityCalendarFilters(state);
+ return [
+ ...otherFilters,
+ {
+ type: calendarThreadFilterTypes.COMMUNITY,
+ threadIDs: action.payload.threadIDs,
+ },
+ ];
+ } else if (action.type === clearCalendarCommunityFilter) {
+ return nonCommunityCalendarFilters(state);
} else if (
action.type === newThreadActionTypes.success ||
action.type === joinThreadActionTypes.success ||
diff --git a/lib/selectors/calendar-filter-selectors.js b/lib/selectors/calendar-filter-selectors.js
--- a/lib/selectors/calendar-filter-selectors.js
+++ b/lib/selectors/calendar-filter-selectors.js
@@ -72,6 +72,19 @@
nonExcludeDeletedCalendarFilters,
);
+function nonCommunityCalendarFilters(
+ calendarFilters: $ReadOnlyArray<CalendarFilter>,
+): $ReadOnlyArray<CalendarFilter> {
+ return filterFilters(calendarFilters, calendarThreadFilterTypes.COMMUNITY);
+}
+
+const nonCommunityCalendarFiltersSelector: (
+ state: BaseAppState<*>,
+) => $ReadOnlyArray<CalendarFilter> = createSelector(
+ (state: BaseAppState<*>) => state.calendarFilters,
+ nonCommunityCalendarFilters,
+);
+
function filterExists(
calendarFilters: $ReadOnlyArray<CalendarFilter>,
filterType: CalendarThreadFilterType,
@@ -99,6 +112,8 @@
nonThreadCalendarFiltersSelector,
nonExcludeDeletedCalendarFilters,
nonExcludeDeletedCalendarFiltersSelector,
+ nonCommunityCalendarFilters,
+ nonCommunityCalendarFiltersSelector,
filterExists,
includeDeletedSelector,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 11, 12:36 AM (14 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5917293
Default Alt Text
D6458.1768091787.diff (2 KB)
Attached To
Mode
D6458: [web] Add to calendar filters reducer logic for handling the COMMUNITY filters
Attached
Detach File
Event Timeline
Log In to Comment