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 @@ -46,13 +46,12 @@ threadTypeIsCommunityRoot, type ThreadType, } from '../types/thread-types-enum.js'; -import { - type SidebarInfo, - type LegacyRawThreadInfos, - type RelativeMemberInfo, - type ThreadInfo, - type RawThreadInfo, - type RawThreadInfos, +import type { + SidebarInfo, + RelativeMemberInfo, + ThreadInfo, + RawThreadInfo, + RawThreadInfos, } from '../types/thread-types.js'; import { dateString, dateFromString } from '../utils/date-utils.js'; import { values } from '../utils/objects.js'; @@ -275,7 +274,7 @@ const unreadCount: (state: BaseAppState<>) => number = createSelector( (state: BaseAppState<>) => state.threadStore.threadInfos, - (threadInfos: LegacyRawThreadInfos): number => + (threadInfos: RawThreadInfos): number => values(threadInfos).filter( threadInfo => threadInHomeChatList(threadInfo) && threadInfo.currentUser.unread, @@ -284,7 +283,7 @@ const unreadBackgroundCount: (state: BaseAppState<>) => number = createSelector( (state: BaseAppState<>) => state.threadStore.threadInfos, - (threadInfos: LegacyRawThreadInfos): number => + (threadInfos: RawThreadInfos): number => values(threadInfos).filter( threadInfo => threadInBackgroundChatList(threadInfo) && threadInfo.currentUser.unread, @@ -357,7 +356,7 @@ function mostRecentlyReadThread( messageStore: MessageStore, - threadInfos: LegacyRawThreadInfos, + threadInfos: RawThreadInfos, ): ?string { let mostRecent = null; for (const threadID in threadInfos) { @@ -399,7 +398,7 @@ (state: BaseAppState<>) => state.threadStore.threadInfos, threadInfoSelector, ( - rawThreadInfos: LegacyRawThreadInfos, + rawThreadInfos: RawThreadInfos, threadInfos: { +[id: string]: ThreadInfo }, ) => { const pendingToRealizedThreadIDs = 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 @@ -14,11 +14,11 @@ import type { BaseAppState } from '../types/redux-types.js'; import { userRelationshipStatus } from '../types/relationship-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; -import { - type LegacyRawThreadInfo, - type LegacyRelativeMemberInfo, - type LegacyRawThreadInfos, - type RelativeMemberInfo, +import type { + LegacyRawThreadInfo, + LegacyRelativeMemberInfo, + RelativeMemberInfo, + RawThreadInfos, } from '../types/thread-types.js'; import type { UserInfos, @@ -210,7 +210,7 @@ ) => $ReadOnlySet = createSelector( (state: BaseAppState<>) => state.currentUserInfo && state.currentUserInfo.id, (state: BaseAppState<>) => state.threadStore.threadInfos, - (viewerID: ?string, threadInfos: LegacyRawThreadInfos) => { + (viewerID: ?string, threadInfos: RawThreadInfos) => { const personalThreadMembers = new Set(); for (const threadID in threadInfos) {