Page MenuHomePhabricator

D10272.diff
No OneTemporary

D10272.diff

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

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)

Event Timeline