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 =>