Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33309905
D10125.1768806139.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D10125.1768806139.diff
View Options
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<ChatThreadItem> {
const threadInfos = useSelector(threadInfoSelector);
const messageInfos = useSelector(messageInfoSelector);
@@ -259,13 +253,7 @@
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
sidebarInfos: { +[id: string]: $ReadOnlyArray<SidebarInfo> },
- filterFunction: (
- threadInfo: ?(
- | LegacyThreadInfo
- | MinimallyEncodedThreadInfo
- | RawThreadInfo
- ),
- ) => boolean,
+ filterFunction: (threadInfo: ?(ThreadInfo | RawThreadInfo)) => boolean,
): $ReadOnlyArray<ChatThreadItem> {
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<AccountUserInfo>,
- +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<RawThreadInfo | ThreadInfo>,
): 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];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 7:02 AM (13 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5955053
Default Alt Text
D10125.1768806139.diff (5 KB)
Attached To
Mode
D10125: [lib] Consume "new" `ThreadInfo` in `lib/selectors`
Attached
Detach File
Event Timeline
Log In to Comment