diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js --- a/lib/selectors/chat-selectors.js +++ b/lib/selectors/chat-selectors.js @@ -35,13 +35,13 @@ type LocalMessageInfo, isComposableMessageType, } from '../types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseAppState } from '../types/redux-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; import { type LegacyThreadInfo, type RawThreadInfo, type SidebarInfo, + type ThreadInfo, maxReadSidebars, maxUnreadSidebars, } from '../types/thread-types.js'; @@ -96,7 +96,7 @@ } function getMostRecentMessageInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: ThreadInfo, messageStore: MessageStore, messages: { +[id: string]: ?MessageInfo }, ): ?MessageInfo { @@ -115,7 +115,7 @@ } function getLastUpdatedTime( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: ThreadInfo, mostRecentMessageInfo: ?MessageInfo, ): number { return mostRecentMessageInfo @@ -228,13 +228,7 @@ } function useFilteredChatListData( - filterFunction: ( - threadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - | RawThreadInfo - ), - ) => boolean, + filterFunction: (threadInfo: ?(ThreadInfo | RawThreadInfo)) => boolean, ): $ReadOnlyArray { const threadInfos = useSelector(threadInfoSelector); const messageInfos = useSelector(messageInfoSelector); @@ -259,13 +253,7 @@ messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, sidebarInfos: { +[id: string]: $ReadOnlyArray }, - filterFunction: ( - threadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - | RawThreadInfo - ), - ) => boolean, + filterFunction: (threadInfo: ?(ThreadInfo | RawThreadInfo)) => boolean, ): $ReadOnlyArray { return _flow( _filter(filterFunction), @@ -289,7 +277,7 @@ +startsCluster: boolean, endsCluster: boolean, +robotext: EntityText, - +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?ThreadInfo, +reactions: ReactionInfo, }; export type ChatMessageInfoItem = @@ -302,9 +290,7 @@ +startsConversation: boolean, +startsCluster: boolean, endsCluster: boolean, - +threadCreatedFromMessage: - | ?LegacyThreadInfo - | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?ThreadInfo, +reactions: ReactionInfo, +hasBeenEdited: boolean, +isPinned: boolean, @@ -622,7 +608,7 @@ export type UseMessageListDataArgs = { +searching: boolean, +userInfoInputArray: $ReadOnlyArray, - +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: ?ThreadInfo, }; function useMessageListData({ diff --git a/lib/selectors/nav-selectors.js b/lib/selectors/nav-selectors.js --- a/lib/selectors/nav-selectors.js +++ b/lib/selectors/nav-selectors.js @@ -12,10 +12,9 @@ defaultCalendarQuery, } from '../types/entry-types.js'; import type { CalendarFilter } from '../types/filter-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseNavInfo } from '../types/nav-types.js'; import type { BaseAppState } from '../types/redux-types.js'; -import type { RawThreadInfo, LegacyThreadInfo } from '../types/thread-types.js'; +import type { RawThreadInfo, ThreadInfo } from '../types/thread-types.js'; import type { UserInfo } from '../types/user-types.js'; import { getConfig } from '../utils/config.js'; import { values } from '../utils/objects.js'; @@ -80,9 +79,7 @@ const useENSNamesOptions = { allAtOnce: true }; function useThreadSearchIndex( - threadInfos: $ReadOnlyArray< - RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + threadInfos: $ReadOnlyArray, ): SearchIndex { const userInfos = useSelector(state => state.userStore.userInfos); const viewerID = useSelector( 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 @@ -39,7 +39,6 @@ import type { ClientAvatar, ClientEmojiAvatar } from '../types/avatar-types'; import type { EntryInfo } from '../types/entry-types.js'; import type { MessageStore, RawMessageInfo } from '../types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseAppState } from '../types/redux-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import { @@ -53,6 +52,7 @@ type SidebarInfo, type LegacyRawThreadInfos, type RelativeMemberInfo, + type ThreadInfo, } from '../types/thread-types.js'; import { dateString, dateFromString } from '../utils/date-utils.js'; import { values } from '../utils/objects.js'; @@ -228,7 +228,7 @@ ); function getMostRecentRawMessageInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: ThreadInfo, messageStore: MessageStore, ): ?RawMessageInfo { const thread = messageStore.threads[threadInfo.id];