Hide show story notification count if stories are not enabled

This commit is contained in:
trevor-signal 2023-09-07 15:03:10 -04:00 committed by GitHub
parent ecab90041b
commit c8c10d2d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(