Page MenuHomePhabricator

D12158.id40798.diff
No OneTemporary

D12158.id40798.diff

diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js
--- a/lib/shared/thread-utils.js
+++ b/lib/shared/thread-utils.js
@@ -43,7 +43,6 @@
RelativeMemberInfo,
RawThreadInfo,
MemberInfo,
- ThreadCurrentUserInfo,
RoleInfo,
ThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
@@ -821,7 +820,7 @@
community: rawThreadInfo.community,
members: getRelativeMemberInfos(rawThreadInfo, viewerID, userInfos),
roles: rawThreadInfo.roles,
- currentUser: getCurrentUser(rawThreadInfo, viewerID, userInfos),
+ currentUser: rawThreadInfo.currentUser,
repliesCount: rawThreadInfo.repliesCount,
};
@@ -861,22 +860,6 @@
return encodedUpdatedPermissions;
}
-function getCurrentUser(
- threadInfo: RawThreadInfo | ThreadInfo,
- viewerID: ?string,
- userInfos: UserInfos,
-): ThreadCurrentUserInfo {
- if (!threadFrozenDueToBlock(threadInfo, viewerID, userInfos)) {
- return threadInfo.currentUser;
- }
- return {
- ...threadInfo.currentUser,
- permissions: filterOutDisabledPermissions(
- threadInfo.currentUser.permissions,
- ),
- };
-}
-
type ThreadIsWithBlockedUserOnlyOptions = {
checkOnlyViewerBlock: boolean,
skipMemberAdminRoleCheck: boolean,
@@ -1120,7 +1103,6 @@
): ExistingThreadInfoFinder {
const threadInfos = useSelector(threadInfoSelector);
const loggedInUserInfo = useLoggedInUserInfo();
- const userInfos = useSelector(state => state.userStore.userInfos);
const pendingToRealizedThreadIDs = useSelector(state =>
pendingToRealizedThreadIDsSelector(state.threadStore.threadInfos),
@@ -1177,16 +1159,10 @@
return {
...updatedThread,
- currentUser: getCurrentUser(updatedThread, viewerID, userInfos),
+ currentUser: updatedThread.currentUser,
};
},
- [
- baseThreadInfo,
- threadInfos,
- loggedInUserInfo,
- pendingToRealizedThreadIDs,
- userInfos,
- ],
+ [baseThreadInfo, threadInfos, loggedInUserInfo, pendingToRealizedThreadIDs],
);
}
@@ -1637,7 +1613,6 @@
extractNewMentionedParentMembers,
pendingThreadType,
filterOutDisabledPermissions,
- getCurrentUser,
threadFrozenDueToBlock,
threadFrozenDueToViewerBlock,
rawThreadInfoFromServerThreadInfo,

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:24 PM (18 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575555
Default Alt Text
D12158.id40798.diff (2 KB)

Event Timeline