Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33298902
D14175.1768765208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14175.1768765208.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, Jan 18, 7:40 PM (12 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5952851
Default Alt Text
D14175.1768765208.diff (1 KB)
Attached To
Mode
D14175: [lib] Always include an extra item in getCandidateSidebarItemsForThreadList
Attached
Detach File
Event Timeline
Log In to Comment