Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3387199
D12493.id41730.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
953 B
Referenced Files
None
Subscribers
None
D12493.id41730.diff
View Options
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
@@ -45,7 +45,6 @@
MemberInfoWithPermissions,
RoleInfo,
ThreadInfo,
- MemberInfoSansPermissions,
} from '../types/minimally-encoded-thread-permissions-types.js';
import {
decodeMinimallyEncodedRoleInfo,
@@ -313,13 +312,15 @@
.map(memberInfo => memberInfo.id);
}
-function threadOtherMembers<
- T:
- | LegacyMemberInfo
- | MemberInfoWithPermissions
- | MemberInfoSansPermissions
- | RelativeMemberInfo,
->(memberInfos: $ReadOnlyArray<T>, viewerID: ?string): $ReadOnlyArray<T> {
+type MemberIDAndRole = {
+ +id: string,
+ +role: ?string,
+ ...
+};
+function threadOtherMembers<T: MemberIDAndRole>(
+ memberInfos: $ReadOnlyArray<T>,
+ viewerID: ?string,
+): $ReadOnlyArray<T> {
return memberInfos.filter(
memberInfo => memberInfo.role && memberInfo.id !== viewerID,
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 8:13 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2600226
Default Alt Text
D12493.id41730.diff (953 B)
Attached To
Mode
D12493: [lib] Simplify threadOtherMembers
Attached
Detach File
Event Timeline
Log In to Comment