Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3311470
D13534.id44715.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13534.id44715.diff
View Options
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
@@ -1282,52 +1282,37 @@
const { sourceMessageID } = baseThreadInfo;
+ let pendingThreadID;
if (searching) {
- const pendingThinThreadID = getPendingThreadID(
- pendingThreadType(userInfoInputArray.length, 'thin'),
- [...userInfoInputArray.map(user => user.id), viewerID],
- sourceMessageID,
- );
- const realizedThinThreadID =
- pendingToRealizedThreadIDs.get(pendingThinThreadID);
- if (realizedThinThreadID && threadInfos[realizedThinThreadID]) {
- return threadInfos[realizedThinThreadID];
- }
- const pendingThickThreadID = getPendingThreadID(
+ pendingThreadID = getPendingThreadID(
pendingThreadType(userInfoInputArray.length, 'thick'),
[...userInfoInputArray.map(user => user.id), viewerID],
sourceMessageID,
);
- const realizedThickThreadID =
- pendingToRealizedThreadIDs.get(pendingThickThreadID);
- if (realizedThickThreadID && threadInfos[realizedThickThreadID]) {
- return threadInfos[realizedThickThreadID];
- }
} else {
- const pendingThinThreadID = getPendingThreadID(
+ pendingThreadID = getPendingThreadID(
baseThreadInfo.type,
baseThreadInfo.members.map(member => member.id),
sourceMessageID,
);
- const realizedThreadID =
- pendingToRealizedThreadIDs.get(pendingThinThreadID);
- if (realizedThreadID && threadInfos[realizedThreadID]) {
- return threadInfos[realizedThreadID];
- }
+ }
+ const realizedThreadID = pendingToRealizedThreadIDs.get(pendingThreadID);
+ if (realizedThreadID && threadInfos[realizedThreadID]) {
+ return threadInfos[realizedThreadID];
}
- const updatedThread = searching
- ? createPendingThread({
- viewerID,
- threadType: pendingThreadType(
- userInfoInputArray.length,
- params.allUsersSupportThickThreads ? 'thick' : 'thin',
- ),
- members: [loggedInUserInfo, ...userInfoInputArray],
- })
- : baseThreadInfo;
-
- return updatedThread;
+ if (!searching) {
+ return baseThreadInfo;
+ }
+
+ return createPendingThread({
+ viewerID,
+ threadType: pendingThreadType(
+ userInfoInputArray.length,
+ params.allUsersSupportThickThreads ? 'thick' : 'thin',
+ ),
+ members: [loggedInUserInfo, ...userInfoInputArray],
+ });
},
[baseThreadInfo, threadInfos, loggedInUserInfo, pendingToRealizedThreadIDs],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 8:54 AM (18 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2539935
Default Alt Text
D13534.id44715.diff (2 KB)
Attached To
Mode
D13534: [lib] Simplify useExistingThreadInfoFinder
Attached
Detach File
Event Timeline
Log In to Comment