Hide show story notification count if stories are not enabled
This commit is contained in:
parent
ecab90041b
commit
c8c10d2d76
1 changed files with 11 additions and 1 deletions
|
@ -43,6 +43,7 @@ import {
|
|||
resolveStorySendStatus,
|
||||
} from '../../util/resolveStorySendStatus';
|
||||
import { BodyRange, hydrateRanges } from '../../types/BodyRange';
|
||||
import { getStoriesEnabled } from './items';
|
||||
|
||||
export const getStoriesState = (state: StateType): StoriesStateType =>
|
||||
state.stories;
|
||||
|
@ -467,9 +468,18 @@ export const getStories = createSelector(
|
|||
);
|
||||
|
||||
export const getStoriesNotificationCount = createSelector(
|
||||
getStoriesEnabled,
|
||||
getHideStoryConversationIds,
|
||||
getStoriesState,
|
||||
(hideStoryConversationIds, { lastOpenedAtTimestamp, stories }): number => {
|
||||
(
|
||||
storiesEnabled,
|
||||
hideStoryConversationIds,
|
||||
{ lastOpenedAtTimestamp, stories }
|
||||
): number => {
|
||||
if (!storiesEnabled) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const hiddenConversationIds = new Set(hideStoryConversationIds);
|
||||
|
||||
return new Set(
|
||||
|
|
Loading…
Reference in a new issue