Page MenuHomePhabricator

D14175.diff
No OneTemporary

D14175.diff

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

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)

Event Timeline