diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js --- a/lib/selectors/thread-selectors.js +++ b/lib/selectors/thread-selectors.js @@ -53,7 +53,7 @@ import { type ThreadInfo, type RawThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, type SidebarInfo, type RawThreadInfos, } from '../types/thread-types.js'; @@ -328,7 +328,7 @@ ( threadInfo: ?RawThreadInfo, members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ): boolean => { if (!threadInfo) { 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 @@ -17,7 +17,7 @@ import { threadTypes } from '../types/thread-types-enum.js'; import { type RawThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, type RawThreadInfos, } from '../types/thread-types.js'; import type { @@ -58,7 +58,7 @@ threadInfo: ?RawThreadInfo, currentUserID: ?string, userInfos: UserInfos, -): $ReadOnlyArray { +): $ReadOnlyArray { const relativeMemberInfos = []; if (!threadInfo) { return relativeMemberInfos; @@ -94,12 +94,12 @@ return relativeMemberInfos; } -const emptyArray: $ReadOnlyArray = []; +const emptyArray: $ReadOnlyArray = []; // Includes current user at the start const baseRelativeMemberInfoSelectorForMembersOfThread: ( threadID: ?string, -) => (state: BaseAppState<>) => $ReadOnlyArray = ( +) => (state: BaseAppState<>) => $ReadOnlyArray = ( threadID: ?string, ) => { if (!threadID) { @@ -118,8 +118,9 @@ threadID: ?string, ) => ( state: BaseAppState<>, -) => $ReadOnlyArray = - _memoize(baseRelativeMemberInfoSelectorForMembersOfThread); +) => $ReadOnlyArray< + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +> = _memoize(baseRelativeMemberInfoSelectorForMembersOfThread); const userInfoSelectorForPotentialMembers: (state: BaseAppState<>) => { [id: string]: AccountUserInfo, diff --git a/lib/shared/markdown.js b/lib/shared/markdown.js --- a/lib/shared/markdown.js +++ b/lib/shared/markdown.js @@ -11,7 +11,7 @@ MinimallyEncodedResolvedThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { - RelativeMemberInfo, + LegacyRelativeMemberInfo, ResolvedThreadInfo, ChatMentionCandidates, } from '../types/thread-types.js'; @@ -203,7 +203,7 @@ function createMemberMapForUserMentions( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ): $ReadOnlyMap { const membersMap = new Map(); diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -12,7 +12,7 @@ import { threadTypes } from '../types/thread-types-enum.js'; import type { ThreadInfo, - RelativeMemberInfo, + LegacyRelativeMemberInfo, ResolvedThreadInfo, ChatMentionCandidates, } from '../types/thread-types.js'; @@ -30,7 +30,7 @@ type MentionTypeaheadUserSuggestionItem = { +type: 'user', - +userInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +userInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, }; type MentionTypeaheadChatSuggestionItem = { @@ -110,7 +110,7 @@ function getMentionTypeaheadUserSuggestions( userSearchIndex: SentencePrefixSearchIndex, threadMembers: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, viewerID: ?string, usernamePrefix: string, @@ -169,7 +169,9 @@ function getUserMentionsCandidates( threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo, -): $ReadOnlyArray { +): $ReadOnlyArray< + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +> { if (threadInfo.type !== threadTypes.SIDEBAR) { return threadInfo.members; } 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 @@ -85,7 +85,7 @@ type ThreadInfo, type MemberInfo, type ServerThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, type ThreadCurrentUserInfo, type RoleInfo, type ServerMemberInfo, @@ -277,7 +277,7 @@ function threadActualMembers( memberInfos: $ReadOnlyArray< - MemberInfo | RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + MemberInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ): $ReadOnlyArray { return memberInfos @@ -286,7 +286,7 @@ } function threadOtherMembers< - T: MemberInfo | RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + T: MemberInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >(memberInfos: $ReadOnlyArray, viewerID: ?string): $ReadOnlyArray { return memberInfos.filter( memberInfo => memberInfo.role && memberInfo.id !== viewerID, @@ -529,7 +529,7 @@ // Returns map from lowercase username to AccountUserInfo function memberLowercaseUsernameMap( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ): Map { const memberMap = new Map(); @@ -948,7 +948,7 @@ let threadMembers: | $ReadOnlyArray - | $ReadOnlyArray; + | $ReadOnlyArray; let memberEntities: $ReadOnlyArray; // Branching below is to appease flow if (threadInfo.minimallyEncoded) { @@ -1130,7 +1130,7 @@ function memberIsAdmin( memberInfo: - | RelativeMemberInfo + | LegacyRelativeMemberInfo | MemberInfo | MinimallyEncodedRelativeMemberInfo, threadInfo: @@ -1148,7 +1148,7 @@ // "parent admin" as anybody with CHANGE_ROLE permissions. function memberHasAdminPowers( memberInfo: - | RelativeMemberInfo + | LegacyRelativeMemberInfo | MemberInfo | ServerMemberInfo | MinimallyEncodedRelativeMemberInfo, @@ -1651,7 +1651,7 @@ function removeMemberFromThread( threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, - memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, dispatchActionPromise: DispatchActionPromise, removeUserFromThreadServerCall: ( input: RemoveUsersFromThreadInput, @@ -1670,7 +1670,7 @@ function switchMemberAdminRoleInThread( threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, - memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, isCurrentlyAdmin: boolean, dispatchActionPromise: DispatchActionPromise, changeUserRoleServerCall: ( @@ -1701,7 +1701,7 @@ } function getAvailableThreadMemberActions( - memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, canEdit: ?boolean = true, ): $ReadOnlyArray<'change_role' | 'remove_user'> { diff --git a/lib/types/minimally-encoded-thread-permissions-types.js b/lib/types/minimally-encoded-thread-permissions-types.js --- a/lib/types/minimally-encoded-thread-permissions-types.js +++ b/lib/types/minimally-encoded-thread-permissions-types.js @@ -5,7 +5,7 @@ import type { LegacyMemberInfo, RawThreadInfo, - RelativeMemberInfo, + LegacyRelativeMemberInfo, LegacyRoleInfo, ThreadCurrentUserInfo, ThreadInfo, @@ -102,7 +102,7 @@ }>; const minimallyEncodeRelativeMemberInfo = ( - relativeMemberInfo: RelativeMemberInfo, + relativeMemberInfo: LegacyRelativeMemberInfo, ): MinimallyEncodedRelativeMemberInfo => ({ ...relativeMemberInfo, minimallyEncoded: true, @@ -111,7 +111,7 @@ const decodeMinimallyEncodedRelativeMemberInfo = ( minimallyEncodedRelativeMemberInfo: MinimallyEncodedRelativeMemberInfo, -): RelativeMemberInfo => { +): LegacyRelativeMemberInfo => { const { minimallyEncoded, ...rest } = minimallyEncodedRelativeMemberInfo; return { ...rest, diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js --- a/lib/types/thread-types.js +++ b/lib/types/thread-types.js @@ -56,12 +56,12 @@ export type MemberInfo = LegacyMemberInfo | MinimallyEncodedMemberInfo; -export type RelativeMemberInfo = $ReadOnly<{ +export type LegacyRelativeMemberInfo = $ReadOnly<{ ...LegacyMemberInfo, +username: ?string, +isViewer: boolean, }>; -const relativeMemberInfoValidator = tShape({ +const legacyRelativeMemberInfoValidator = tShape({ ...legacyMemberInfoValidator.meta.props, username: t.maybe(t.String), isViewer: t.Boolean, @@ -150,7 +150,7 @@ +parentThreadID: ?string, +containingThreadID: ?string, +community: ?string, - +members: $ReadOnlyArray, + +members: $ReadOnlyArray, +roles: { +[id: string]: LegacyRoleInfo }, +currentUser: ThreadCurrentUserInfo, +sourceMessageID?: string, @@ -169,7 +169,7 @@ parentThreadID: t.maybe(tID), containingThreadID: t.maybe(tID), community: t.maybe(tID), - members: t.list(relativeMemberInfoValidator), + members: t.list(legacyRelativeMemberInfoValidator), roles: t.dict(tID, legacyRoleInfoValidator), currentUser: threadCurrentUserInfoValidator, sourceMessageID: t.maybe(tID), @@ -189,7 +189,7 @@ +parentThreadID: ?string, +containingThreadID: ?string, +community: ?string, - +members: $ReadOnlyArray, + +members: $ReadOnlyArray, +roles: { +[id: string]: LegacyRoleInfo }, +currentUser: ThreadCurrentUserInfo, +sourceMessageID?: string, diff --git a/lib/utils/role-utils.js b/lib/utils/role-utils.js --- a/lib/utils/role-utils.js +++ b/lib/utils/role-utils.js @@ -15,7 +15,7 @@ } from '../types/thread-permission-types.js'; import type { ThreadInfo, - RelativeMemberInfo, + LegacyRelativeMemberInfo, RoleInfo, } from '../types/thread-types'; import { threadTypes } from '../types/thread-types-enum.js'; @@ -62,7 +62,7 @@ function useRolesFromCommunityThreadInfo( threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, memberInfos: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ): $ReadOnlyMap { // Our in-code system has chat-specific roles, while the diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -81,7 +81,7 @@ ThreadInfo, ClientThreadJoinRequest, ThreadJoinPayload, - RelativeMemberInfo, + LegacyRelativeMemberInfo, ChatMentionCandidates, } from 'lib/types/thread-types.js'; import { type UserInfos } from 'lib/types/user-types.js'; @@ -300,7 +300,7 @@ +inputState: ?InputState, +userSearchIndex: SentencePrefixSearchIndex, +userMentionsCandidates: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, +chatMentionSearchIndex: SentencePrefixSearchIndex, +chatMentionCandidates: ChatMentionCandidates, diff --git a/native/chat/settings/thread-settings-member-tooltip-modal.react.js b/native/chat/settings/thread-settings-member-tooltip-modal.react.js --- a/native/chat/settings/thread-settings-member-tooltip-modal.react.js +++ b/native/chat/settings/thread-settings-member-tooltip-modal.react.js @@ -9,7 +9,10 @@ MinimallyEncodedRelativeMemberInfo, MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types.js'; +import type { + ThreadInfo, + LegacyRelativeMemberInfo, +} from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; import ThreadSettingsMemberTooltipButton from './thread-settings-member-tooltip-button.react.js'; @@ -25,7 +28,7 @@ import Alert from '../../utils/alert.js'; export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{ - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }>; diff --git a/native/chat/settings/thread-settings-member.react.js b/native/chat/settings/thread-settings-member.react.js --- a/native/chat/settings/thread-settings-member.react.js +++ b/native/chat/settings/thread-settings-member.react.js @@ -25,7 +25,7 @@ } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, } from 'lib/types/thread-types.js'; import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js'; @@ -93,7 +93,7 @@ }; type BaseProps = { - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +canEdit: boolean, +navigate: ThreadSettingsNavigate, diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js --- a/native/chat/settings/thread-settings.react.js +++ b/native/chat/settings/thread-settings.react.js @@ -44,7 +44,7 @@ import { type ThreadInfo, type ResolvedThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, } from 'lib/types/thread-types.js'; import type { UserInfos } from 'lib/types/user-types.js'; import { @@ -210,7 +210,9 @@ | { +itemType: 'member', +key: string, - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: + | LegacyRelativeMemberInfo + | MinimallyEncodedRelativeMemberInfo, +threadInfo: ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo, +canEdit: boolean, +navigate: ThreadSettingsNavigate, @@ -1142,7 +1144,7 @@ const threadMembersChangeIsSaving = ( state: AppState, threadMembers: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ) => { for (const threadMember of threadMembers) { diff --git a/native/markdown/rules.react.js b/native/markdown/rules.react.js --- a/native/markdown/rules.react.js +++ b/native/markdown/rules.react.js @@ -12,7 +12,7 @@ MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { - RelativeMemberInfo, + LegacyRelativeMemberInfo, ThreadInfo, ChatMentionCandidates, } from 'lib/types/thread-types.js'; @@ -378,7 +378,7 @@ function textMessageRules( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, chatMentionCandidates: ChatMentionCandidates, useDarkStyle: boolean, diff --git a/native/roles/change-roles-screen.react.js b/native/roles/change-roles-screen.react.js --- a/native/roles/change-roles-screen.react.js +++ b/native/roles/change-roles-screen.react.js @@ -16,7 +16,10 @@ MinimallyEncodedRelativeMemberInfo, MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js'; +import type { + LegacyRelativeMemberInfo, + ThreadInfo, +} from 'lib/types/thread-types.js'; import { values } from 'lib/utils/objects.js'; import ChangeRolesHeaderRightButton from './change-roles-header-right-button.react.js'; @@ -29,7 +32,7 @@ export type ChangeRolesScreenParams = { +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +role: ?string, }; diff --git a/web/input/input-state.js b/web/input/input-state.js --- a/web/input/input-state.js +++ b/web/input/input-state.js @@ -15,7 +15,7 @@ } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadInfo, - RelativeMemberInfo, + LegacyRelativeMemberInfo, ChatMentionCandidates, } from 'lib/types/thread-types.js'; @@ -52,7 +52,7 @@ +canBeVisible: boolean, +keepUpdatingThreadMembers: boolean, +frozenUserMentionsCandidates: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, +frozenChatMentionsCandidates: ChatMentionCandidates, +moveChoiceUp: ?() => void, diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js --- a/web/markdown/rules.react.js +++ b/web/markdown/rules.react.js @@ -11,7 +11,7 @@ MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { - RelativeMemberInfo, + LegacyRelativeMemberInfo, ThreadInfo, ChatMentionCandidates, } from 'lib/types/thread-types.js'; @@ -184,7 +184,7 @@ function textMessageRules( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, chatMentionCandidates: ChatMentionCandidates, useDarkStyle: boolean, diff --git a/web/modals/threads/create/steps/subchannel-members-list.react.js b/web/modals/threads/create/steps/subchannel-members-list.react.js --- a/web/modals/threads/create/steps/subchannel-members-list.react.js +++ b/web/modals/threads/create/steps/subchannel-members-list.react.js @@ -8,7 +8,10 @@ MinimallyEncodedRelativeMemberInfo, MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js'; +import type { + LegacyRelativeMemberInfo, + ThreadInfo, +} from 'lib/types/thread-types.js'; import type { UserListItem } from 'lib/types/user-types.js'; import { useSelector } from '../../../../redux/redux-utils.js'; @@ -45,7 +48,7 @@ const filterOutParentMembersWithENSNames = React.useCallback( ( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ) => members @@ -70,7 +73,7 @@ const filterOutOtherMembersWithENSNames = React.useCallback( ( members: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, ) => members diff --git a/web/modals/threads/members/change-member-role-modal.react.js b/web/modals/threads/members/change-member-role-modal.react.js --- a/web/modals/threads/members/change-member-role-modal.react.js +++ b/web/modals/threads/members/change-member-role-modal.react.js @@ -15,7 +15,10 @@ MinimallyEncodedRelativeMemberInfo, MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; -import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types'; +import type { + LegacyRelativeMemberInfo, + ThreadInfo, +} from 'lib/types/thread-types'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; import { values } from 'lib/utils/objects.js'; @@ -28,7 +31,7 @@ import UnsavedChangesModal from '../../unsaved-changes-modal.react.js'; type ChangeMemberRoleModalProps = { - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, }; diff --git a/web/modals/threads/members/member.react.js b/web/modals/threads/members/member.react.js --- a/web/modals/threads/members/member.react.js +++ b/web/modals/threads/members/member.react.js @@ -16,7 +16,7 @@ MinimallyEncodedThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, type ThreadInfo, } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/action-utils.js'; @@ -34,7 +34,7 @@ const commIconComponent = ; type Props = { - +memberInfo: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +setOpenMenu: SetState, }; diff --git a/web/modals/threads/members/members-list.react.js b/web/modals/threads/members/members-list.react.js --- a/web/modals/threads/members/members-list.react.js +++ b/web/modals/threads/members/members-list.react.js @@ -13,7 +13,7 @@ } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ThreadInfo, - type RelativeMemberInfo, + type LegacyRelativeMemberInfo, } from 'lib/types/thread-types.js'; import ThreadMember from './member.react.js'; @@ -22,7 +22,7 @@ type Props = { +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo, +threadMembers: $ReadOnlyArray< - RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, >, }; @@ -50,7 +50,9 @@ .sort((a, b) => stringForUser(a).localeCompare(stringForUser(b))) .map( ( - user: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + user: + | LegacyRelativeMemberInfo + | MinimallyEncodedRelativeMemberInfo, ) => ( threadMembersNotFiltered.filter( - (member: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo) => - searchText.length === 0 || userIDs.includes(member.id), + ( + member: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + ) => searchText.length === 0 || userIDs.includes(member.id), ), [searchText.length, threadMembersNotFiltered, userIDs], ); @@ -53,8 +54,9 @@ const adminMembers = React.useMemo( () => allMembers.filter( - (member: RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo) => - roleIsAdminRole(roles.get(member.id)), + ( + member: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo, + ) => roleIsAdminRole(roles.get(member.id)), ), [allMembers, roles], );