Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3376708
D12292.id41360.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
D12292.id41360.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
@@ -890,7 +890,7 @@
};
function threadIsWithBlockedUserOnly(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
options: ThreadIsWithBlockedUserOnlyOptions,
@@ -952,7 +952,7 @@
}
function innerThreadFrozenDueToBlock(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
skipMemberAdminRoleCheck: boolean,
@@ -966,7 +966,7 @@
}
function threadFrozenDueToBlock(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1016,17 +1016,9 @@
// Since we don't have access to all of the ancestor ThreadInfos, we approximate
// "parent admin" as anybody with CHANGE_ROLE permissions.
function memberHasAdminPowers(
- memberInfo:
- | RelativeMemberInfo
- | LegacyMemberInfo
- | MemberInfo
- | ServerMemberInfo,
+ memberInfo: LegacyMemberInfo | MemberInfo | ServerMemberInfo,
): boolean {
if (memberInfo.minimallyEncoded) {
- invariant(
- memberInfo.permissions,
- 'memberInfo must have permissions field in memberHasAdminPowers',
- );
return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE);
}
return !!memberInfo.permissions[threadPermissions.CHANGE_ROLE]?.value;
@@ -1075,7 +1067,7 @@
}
function threadOrParentThreadHasAdminRole(
- threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo,
+ threadInfo: LegacyRawThreadInfo | RawThreadInfo,
) {
return (
threadMembersWithoutAddedAdmin(threadInfo).filter(member =>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 1:46 AM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592361
Default Alt Text
D12292.id41360.diff (1 KB)
Attached To
Mode
D12292: [lib] Narrow types in `memberHasAdminPowers` call stack to remove `invariant`
Attached
Detach File
Event Timeline
Log In to Comment