Page MenuHomePhorge

D3145.1768246915.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D3145.1768246915.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
@@ -1190,39 +1190,37 @@
usersSearchResults: $ReadOnlyArray<GlobalAccountUserInfo>,
viewerID: ?string,
): $ReadOnlyArray<ChatThreadItem> {
- const chatItems = [];
if (!searchText) {
- chatItems.push(
- ...chatListData.filter(
- item =>
- threadIsTopLevel(item.threadInfo) && threadFilter(item.threadInfo),
- ),
+ return chatListData.filter(
+ item =>
+ threadIsTopLevel(item.threadInfo) && threadFilter(item.threadInfo),
);
- } else {
- const privateThreads = [];
- const personalThreads = [];
- const otherThreads = [];
- for (const item of chatListData) {
- if (!threadSearchResults.has(item.threadInfo.id)) {
- continue;
- }
- if (item.threadInfo.type === threadTypes.PRIVATE) {
- privateThreads.push({ ...item, sidebars: [] });
- } else if (item.threadInfo.type === threadTypes.PERSONAL) {
- personalThreads.push({ ...item, sidebars: [] });
- } else {
- otherThreads.push({ ...item, sidebars: [] });
- }
+ }
+
+ const privateThreads = [];
+ const personalThreads = [];
+ const otherThreads = [];
+ for (const item of chatListData) {
+ if (!threadSearchResults.has(item.threadInfo.id)) {
+ continue;
}
- chatItems.push(...privateThreads, ...personalThreads, ...otherThreads);
- if (viewerID) {
- chatItems.push(
- ...usersSearchResults.map(user =>
- createPendingThreadItem(viewerID, user),
- ),
- );
+ if (item.threadInfo.type === threadTypes.PRIVATE) {
+ privateThreads.push({ ...item, sidebars: [] });
+ } else if (item.threadInfo.type === threadTypes.PERSONAL) {
+ personalThreads.push({ ...item, sidebars: [] });
+ } else {
+ otherThreads.push({ ...item, sidebars: [] });
}
}
+
+ const chatItems = [...privateThreads, ...personalThreads, ...otherThreads];
+ if (viewerID) {
+ chatItems.push(
+ ...usersSearchResults.map(user =>
+ createPendingThreadItem(viewerID, user),
+ ),
+ );
+ }
return chatItems;
}

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 12, 7:41 PM (14 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5924596
Default Alt Text
D3145.1768246915.diff (2 KB)

Event Timeline