Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351546
D10272.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10272.diff
View Options
diff --git a/lib/selectors/user-selectors.js b/lib/selectors/user-selectors.js
--- a/lib/selectors/user-selectors.js
+++ b/lib/selectors/user-selectors.js
@@ -126,12 +126,30 @@
return relativeMemberInfos;
}
-const emptyArray: $ReadOnlyArray<LegacyRelativeMemberInfo> = [];
+function getRelativeMemberInfos(
+ threadInfo: ?MinimallyEncodedRawThreadInfo | LegacyRawThreadInfo,
+ currentUserID: ?string,
+ userInfos: UserInfos,
+): $ReadOnlyArray<
+ MinimallyEncodedRelativeMemberInfo | LegacyRelativeMemberInfo,
+> {
+ if (threadInfo?.minimallyEncoded) {
+ return getMinimallyEncodedRelativeMemberInfos(
+ threadInfo,
+ currentUserID,
+ userInfos,
+ );
+ } else {
+ return getLegacyRelativeMemberInfos(threadInfo, currentUserID, userInfos);
+ }
+}
+
+const emptyArray: $ReadOnlyArray<RelativeMemberInfo> = [];
// Includes current user at the start
const baseRelativeMemberInfoSelectorForMembersOfThread: (
threadID: ?string,
-) => (state: BaseAppState<>) => $ReadOnlyArray<LegacyRelativeMemberInfo> = (
+) => (state: BaseAppState<>) => $ReadOnlyArray<RelativeMemberInfo> = (
threadID: ?string,
) => {
if (!threadID) {
@@ -142,7 +160,7 @@
(state: BaseAppState<>) =>
state.currentUserInfo && state.currentUserInfo.id,
(state: BaseAppState<>) => state.userStore.userInfos,
- getLegacyRelativeMemberInfos,
+ getRelativeMemberInfos,
);
};
@@ -279,6 +297,7 @@
export {
userIDsToRelativeUserInfos,
+ getRelativeMemberInfos,
getMinimallyEncodedRelativeMemberInfos,
getLegacyRelativeMemberInfos,
relativeMemberInfoSelectorForMembersOfThread,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:27 AM (20 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573536
Default Alt Text
D10272.diff (1 KB)
Attached To
Mode
D10272: [lib] Introduce `getRelativeMemberInfos` which helps narrow `[Legacy]RawThreadInfos`
Attached
Detach File
Event Timeline
Log In to Comment