Page MenuHomePhorge

D10435.1765126557.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D10435.1765126557.diff

diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js
--- a/lib/selectors/thread-selectors.js
+++ b/lib/selectors/thread-selectors.js
@@ -290,6 +290,27 @@
).length,
);
+const baseUnreadCountSelectorForCommunity: (
+ communityID: string,
+) => (BaseAppState<>) => number = (communityID: string) =>
+ createSelector(
+ (state: BaseAppState<>) => state.threadStore.threadInfos,
+ (threadInfos: RawThreadInfos): number =>
+ Object.values(threadInfos).filter(
+ threadInfo =>
+ threadInHomeChatList(threadInfo) &&
+ threadInfo.currentUser.unread &&
+ (communityID === threadInfo.community ||
+ communityID === threadInfo.id),
+ ).length,
+ );
+
+const unreadCountSelectorForCommunity: (
+ communityID: string,
+) => (state: BaseAppState<>) => number = _memoize(
+ baseUnreadCountSelectorForCommunity,
+);
+
const baseAncestorThreadInfos: (
threadID: string,
) => (BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = (threadID: string) =>
@@ -518,6 +539,7 @@
containedThreadInfos,
unreadCount,
unreadBackgroundCount,
+ unreadCountSelectorForCommunity,
otherUsersButNoOtherAdmins,
mostRecentlyReadThread,
mostRecentlyReadThreadSelector,

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 7, 4:55 PM (17 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5842201
Default Alt Text
D10435.1765126557.diff (1 KB)

Event Timeline