Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3511774
D14175.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14175.diff
View Options
diff --git a/lib/shared/sidebar-item-utils.js b/lib/shared/sidebar-item-utils.js
--- a/lib/shared/sidebar-item-utils.js
+++ b/lib/shared/sidebar-item-utils.js
@@ -132,7 +132,7 @@
): Promise<$ReadOnlyArray<SidebarThreadItem>> {
if (sidebarInfos.length === 0) {
return [];
- } else if (sidebarInfos.length <= maxUnreadSidebars) {
+ } else if (sidebarInfos.length <= maxUnreadSidebars + 1) {
return await getAllFinalSidebarItems(sidebarInfos);
}
@@ -164,20 +164,22 @@
loaders.filter(loader => loader.threadInfo.currentUser.unread),
);
- const topGeneralPromise =
- generalCache.loadMostRecentChatThreadItems(maxReadSidebars);
- const topUnreadPromise =
- unreadCache.loadMostRecentChatThreadItems(maxUnreadSidebars);
+ const topGeneralPromise = generalCache.loadMostRecentChatThreadItems(
+ maxReadSidebars + 1,
+ );
+ const topUnreadPromise = unreadCache.loadMostRecentChatThreadItems(
+ maxUnreadSidebars + 1,
+ );
const [topGeneralResults, topUnreadResults] = await Promise.all([
topGeneralPromise,
topUnreadPromise,
]);
- const topResults = topUnreadResults.slice(0, maxUnreadSidebars);
+ const topResults = topUnreadResults.slice(0, maxUnreadSidebars + 1);
const topThreadIDs = new Set([
...topResults.map(result => result.threadInfo.id),
]);
- const generalResults = topGeneralResults.slice(0, maxReadSidebars);
+ const generalResults = topGeneralResults.slice(0, maxReadSidebars + 1);
for (const result of generalResults) {
if (!topThreadIDs.has(result.threadInfo.id)) {
topResults.push(result);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 4:03 PM (5 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2691891
Default Alt Text
D14175.diff (1 KB)
Attached To
Mode
D14175: [lib] Always include an extra item in getCandidateSidebarItemsForThreadList
Attached
Detach File
Event Timeline
Log In to Comment