diff --git a/lib/actions/community-actions.js b/lib/actions/community-actions.js --- a/lib/actions/community-actions.js +++ b/lib/actions/community-actions.js @@ -2,3 +2,5 @@ export const updateCalendarCommunityFilter = 'UPDATE_CALENDAR_COMMUNITY_FILTER'; export const clearCalendarCommunityFilter = 'CLEAR_CALENDAR_COMMUNITY_FILTER'; +export const updateChatCommunityFilter = 'UPDATE_CHAT_COMMUNITY_FILTER'; +export const clearChatCommunityFilter = 'CLEAR_CHAT_COMMUNITY_FILTER'; diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -1054,6 +1054,14 @@ | { +type: 'CLEAR_CALENDAR_COMMUNITY_FILTER', +payload: void, + } + | { + +type: 'UPDATE_CHAT_COMMUNITY_FILTER', + +payload: string, + } + | { + +type: 'CLEAR_CHAT_COMMUNITY_FILTER', + +payload: void, }; export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string); diff --git a/web/redux/community-picker-reducer.js b/web/redux/community-picker-reducer.js --- a/web/redux/community-picker-reducer.js +++ b/web/redux/community-picker-reducer.js @@ -3,6 +3,8 @@ import { updateCalendarCommunityFilter, clearCalendarCommunityFilter, + updateChatCommunityFilter, + clearChatCommunityFilter, } from 'lib/actions/community-actions.js'; import type { Action, CommunityPickerStore } from './redux-setup'; @@ -21,6 +23,16 @@ ...communityPickerStore, calendar: null, }; + } else if (action.type === updateChatCommunityFilter) { + return { + ...communityPickerStore, + chat: action.payload, + }; + } else if (action.type === clearChatCommunityFilter) { + return { + ...communityPickerStore, + chat: null, + }; } return communityPickerStore; }