Page MenuHomePhabricator

D13534.id44715.diff
No OneTemporary

D13534.id44715.diff

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

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)

Event Timeline