Update nav tab badges, fix several call tabs issues

This commit is contained in:
Jamie Kyle 2023-08-14 16:28:47 -07:00 committed by Jamie Kyle
parent ed6ffb695a
commit 9c7dc22a23
43 changed files with 1095 additions and 936 deletions

View file

@ -4,6 +4,9 @@
import { createSelector } from 'reselect';
import type { StateType } from '../reducer';
import type { NavStateType } from '../ducks/nav';
import { getAllConversationsUnreadStats } from './conversations';
import { getStoriesNotificationCount } from './stories';
import type { UnreadStats } from '../../util/countUnreadStats';
function getNav(state: StateType): NavStateType {
return state.nav;
@ -12,3 +15,17 @@ function getNav(state: StateType): NavStateType {
export const getSelectedNavTab = createSelector(getNav, nav => {
return nav.selectedNavTab;
});
export const getAppUnreadStats = createSelector(
getAllConversationsUnreadStats,
getStoriesNotificationCount,
(conversationsUnreadStats, storiesNotificationCount): UnreadStats => {
return {
// Note: Conversation unread stats includes the call history unread count.
unreadCount:
conversationsUnreadStats.unreadCount + storiesNotificationCount,
unreadMentionsCount: conversationsUnreadStats.unreadMentionsCount,
markedUnread: conversationsUnreadStats.markedUnread,
};
}
);