Page MenuHomePhabricator

D10126.id34086.diff
No OneTemporary

D10126.id34086.diff

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
@@ -71,9 +71,9 @@
const communityThreadSelector: (
state: BaseAppState<>,
-) => $ReadOnlyArray<LegacyThreadInfo> = createSelector(
+) => $ReadOnlyArray<ThreadInfo> = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
+ (threadInfos: { +[id: string]: ThreadInfo }) => {
const result = [];
for (const threadID in threadInfos) {
const threadInfo = threadInfos[threadID];
@@ -157,7 +157,7 @@
daysToEntries: { +[day: string]: string[] },
startDateString: string,
endDateString: string,
- onScreen: $ReadOnlyArray<LegacyThreadInfo>,
+ onScreen: $ReadOnlyArray<ThreadInfo>,
includeDeleted: boolean,
) => {
const allDaysWithinRange: { [string]: string[] } = {},
@@ -207,11 +207,11 @@
);
const containedThreadInfos: (state: BaseAppState<>) => {
- +[id: string]: $ReadOnlyArray<LegacyThreadInfo>,
+ +[id: string]: $ReadOnlyArray<ThreadInfo>,
} = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
- const result: { [string]: LegacyThreadInfo[] } = {};
+ (threadInfos: { +[id: string]: ThreadInfo }) => {
+ const result: { [string]: ThreadInfo[] } = {};
for (const id in threadInfos) {
const threadInfo = threadInfos[id];
const { containingThreadID } = threadInfo;
@@ -219,7 +219,7 @@
continue;
}
if (result[containingThreadID] === undefined) {
- result[containingThreadID] = ([]: LegacyThreadInfo[]);
+ result[containingThreadID] = ([]: ThreadInfo[]);
}
result[containingThreadID].push(threadInfo);
}
@@ -246,10 +246,7 @@
} = createObjectSelector(
childThreadInfos,
(state: BaseAppState<>) => state.messageStore,
- (
- childThreads: $ReadOnlyArray<LegacyThreadInfo>,
- messageStore: MessageStore,
- ) => {
+ (childThreads: $ReadOnlyArray<ThreadInfo>, messageStore: MessageStore) => {
const sidebarInfos = [];
for (const childThreadInfo of childThreads) {
if (
@@ -298,16 +295,14 @@
const baseAncestorThreadInfos: (
threadID: string,
-) => (BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = (
- threadID: string,
-) =>
+) => (BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = (threadID: string) =>
createSelector(
(state: BaseAppState<>) => threadInfoSelector(state),
(threadInfos: {
- +[id: string]: LegacyThreadInfo,
- }): $ReadOnlyArray<LegacyThreadInfo> => {
- const pathComponents: LegacyThreadInfo[] = [];
- let node: ?LegacyThreadInfo = threadInfos[threadID];
+ +[id: string]: ThreadInfo,
+ }): $ReadOnlyArray<ThreadInfo> => {
+ const pathComponents: ThreadInfo[] = [];
+ let node: ?ThreadInfo = threadInfos[threadID];
while (node) {
pathComponents.push(node);
node = node.parentThreadID ? threadInfos[node.parentThreadID] : null;
@@ -467,7 +462,7 @@
(state: BaseAppState<>) => threadInfoSelector(state)[threadID],
(state: BaseAppState<>) =>
containingThreadID ? threadInfoSelector(state)[containingThreadID] : null,
- (threadInfo: LegacyThreadInfo, containingThreadInfo: ?LegacyThreadInfo) => {
+ (threadInfo: ThreadInfo, containingThreadInfo: ?ThreadInfo) => {
return () => {
let threadAvatar = getAvatarForThread(threadInfo, containingThreadInfo);
if (threadAvatar.type !== 'emoji') {
@@ -487,14 +482,14 @@
const baseThreadInfosSelectorForThreadType: (
threadType: ThreadType,
-) => (BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = (
+) => (BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = (
threadType: ThreadType,
) =>
createSelector(
(state: BaseAppState<>) => threadInfoSelector(state),
(threadInfos: {
- +[id: string]: LegacyThreadInfo,
- }): $ReadOnlyArray<LegacyThreadInfo> => {
+ +[id: string]: ThreadInfo,
+ }): $ReadOnlyArray<ThreadInfo> => {
const result = [];
for (const threadID in threadInfos) {
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
@@ -1429,7 +1429,7 @@
function getThreadListSearchResults(
chatListData: $ReadOnlyArray<ChatThreadItem>,
searchText: string,
- threadFilter: LegacyThreadInfo => boolean,
+ threadFilter: ThreadInfo => boolean,
threadSearchResults: $ReadOnlySet<string>,
usersSearchResults: $ReadOnlyArray<GlobalAccountUserInfo>,
loggedInUserInfo: ?LoggedInUserInfo,
diff --git a/lib/types/messages/create-sidebar.js b/lib/types/messages/create-sidebar.js
--- a/lib/types/messages/create-sidebar.js
+++ b/lib/types/messages/create-sidebar.js
@@ -4,7 +4,7 @@
import { tID, tNumber, tShape } from '../../utils/validation-utils.js';
import { messageTypes } from '../message-types-enum.js';
-import type { LegacyThreadInfo } from '../thread-types.js';
+import type { ThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateSidebarMessageData = {
@@ -51,7 +51,7 @@
+sourceMessageAuthor: RelativeUserInfo,
+initialThreadState: {
+name: ?string,
- +parentThreadInfo: LegacyThreadInfo,
+ +parentThreadInfo: ThreadInfo,
+color: string,
+otherMembers: RelativeUserInfo[],
},
diff --git a/lib/types/messages/create-subthread.js b/lib/types/messages/create-subthread.js
--- a/lib/types/messages/create-subthread.js
+++ b/lib/types/messages/create-subthread.js
@@ -4,7 +4,7 @@
import { tID, tNumber, tShape } from '../../utils/validation-utils.js';
import { messageTypes } from '../message-types-enum.js';
-import type { LegacyThreadInfo } from '../thread-types.js';
+import type { ThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateSubthreadMessageData = {
@@ -36,5 +36,5 @@
threadID: string,
creator: RelativeUserInfo,
time: number,
- childThreadInfo: LegacyThreadInfo,
+ childThreadInfo: ThreadInfo,
};
diff --git a/lib/types/messages/create-thread.js b/lib/types/messages/create-thread.js
--- a/lib/types/messages/create-thread.js
+++ b/lib/types/messages/create-thread.js
@@ -11,7 +11,7 @@
} from '../../utils/validation-utils.js';
import { messageTypes } from '../message-types-enum.js';
import { threadTypes, type ThreadType } from '../thread-types-enum.js';
-import { type LegacyThreadInfo } from '../thread-types.js';
+import type { ThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateThreadMessageData = {
@@ -58,7 +58,7 @@
initialThreadState: {
type: ThreadType,
name: ?string,
- parentThreadInfo: ?LegacyThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
color: string,
otherMembers: RelativeUserInfo[],
},
diff --git a/lib/utils/entity-helpers.js b/lib/utils/entity-helpers.js
--- a/lib/utils/entity-helpers.js
+++ b/lib/utils/entity-helpers.js
@@ -92,7 +92,7 @@
}
function useResolvedThreadInfosObj(
- threadInfosObj: { +[id: string]: LegacyThreadInfo },
+ threadInfosObj: { +[id: string]: ThreadInfo },
options?: ?UseENSNamesOptions,
): { +[id: string]: ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo } {
const threadInfosArray = React.useMemo(

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 12:55 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598859
Default Alt Text
D10126.id34086.diff (7 KB)

Event Timeline