Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3368195
D6968.id23481.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D6968.id23481.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -379,6 +379,7 @@
updatesCurrentAsOf: currentAsOfPromise,
loadingStatuses: {},
calendarFilters: defaultCalendarFilters,
+ pickedCommunityIDs: { chat: null, calendar: null },
// We can use paths local to the <base href> on web
urlPrefix: '',
windowDimensions: { width: 0, height: 0 },
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -60,6 +60,11 @@
export type WindowDimensions = { width: number, height: number };
+export type PickedCommunities = {
+ chat: ?string,
+ calendar: ?string,
+};
+
export type AppState = {
navInfo: NavInfo,
deviceID: ?string,
@@ -73,7 +78,7 @@
updatesCurrentAsOf: number,
loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } },
calendarFilters: $ReadOnlyArray<CalendarFilter>,
- calendarPickedCommunityID: ?string,
+ pickedCommunityIDs: PickedCommunities,
urlPrefix: string,
windowDimensions: WindowDimensions,
cookie?: void,
@@ -153,14 +158,20 @@
threadIDs,
},
],
- calendarPickedCommunityID: action.payload,
+ pickedCommunityIDs: {
+ ...state.pickedCommunityIDs,
+ calendar: action.payload,
+ },
};
} else if (action.type === clearCalendarCommunityFilter) {
const nonThreadFilters = nonThreadCalendarFilters(state.calendarFilters);
return {
...state,
calendarFilters: nonThreadFilters,
- calendarPickedCommunityID: null,
+ pickedCommunityIDs: {
+ ...state.pickedCommunityIDs,
+ calendar: null,
+ },
};
} else if (action.type === setNewSessionActionType) {
if (
diff --git a/web/selectors/calendar-selectors.js b/web/selectors/calendar-selectors.js
--- a/web/selectors/calendar-selectors.js
+++ b/web/selectors/calendar-selectors.js
@@ -44,7 +44,7 @@
const filterThreadIDsBelongingToCommunitySelector: (
state: AppState,
) => ?$ReadOnlySet<string> = createSelector(
- (state: AppState) => state.calendarPickedCommunityID,
+ (state: AppState) => state.pickedCommunityIDs.calendar,
threadInfoSelector,
(
calendarPickedCommunityID: ?string,
@@ -60,9 +60,9 @@
},
);
-function useCommunityIsPicked(communityID: string): boolean {
+function useCommunityIsPickedCalendar(communityID: string): boolean {
const calendarPickedCommunityID = useSelector(
- state => state.calendarPickedCommunityID,
+ state => state.pickedCommunityIDs.calendar,
);
return communityID === calendarPickedCommunityID;
}
@@ -72,5 +72,5 @@
useFilterThreadSearchIndex,
filterThreadIDsBelongingToCommunitySelector,
filterThreadIDsBelongingToCommunity,
- useCommunityIsPicked,
+ useCommunityIsPickedCalendar,
};
diff --git a/web/sidebar/community-drawer-item-handlers.react.js b/web/sidebar/community-drawer-item-handlers.react.js
--- a/web/sidebar/community-drawer-item-handlers.react.js
+++ b/web/sidebar/community-drawer-item-handlers.react.js
@@ -7,7 +7,7 @@
import type { CommunityDrawerItemHandler } from './community-drawer-item-handler.react.js';
import { updateCalendarCommunityFilter } from '../redux/action-types.js';
-import { useCommunityIsPicked } from '../selectors/calendar-selectors.js';
+import { useCommunityIsPickedCalendar } from '../selectors/calendar-selectors.js';
import {
useOnClickThread,
useThreadIsActive,
@@ -45,7 +45,7 @@
payload: threadInfo.id,
});
}, [dispatch, threadInfo.id]);
- const isActive = useCommunityIsPicked(threadInfo.id);
+ const isActive = useCommunityIsPickedCalendar(threadInfo.id);
const handler = React.useMemo(
() => ({ onClick, isActive }),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 6:38 PM (19 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585776
Default Alt Text
D6968.id23481.diff (3 KB)
Attached To
Mode
D6968: [web] Add to redux state picked community in the Chat tab
Attached
Detach File
Event Timeline
Log In to Comment