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,
|
resolveStorySendStatus,
|
||||||
} from '../../util/resolveStorySendStatus';
|
} from '../../util/resolveStorySendStatus';
|
||||||
import { BodyRange, hydrateRanges } from '../../types/BodyRange';
|
import { BodyRange, hydrateRanges } from '../../types/BodyRange';
|
||||||
|
import { getStoriesEnabled } from './items';
|
||||||
|
|
||||||
export const getStoriesState = (state: StateType): StoriesStateType =>
|
export const getStoriesState = (state: StateType): StoriesStateType =>
|
||||||
state.stories;
|
state.stories;
|
||||||
|
@ -467,9 +468,18 @@ export const getStories = createSelector(
|
||||||
);
|
);
|
||||||
|
|
||||||
export const getStoriesNotificationCount = createSelector(
|
export const getStoriesNotificationCount = createSelector(
|
||||||
|
getStoriesEnabled,
|
||||||
getHideStoryConversationIds,
|
getHideStoryConversationIds,
|
||||||
getStoriesState,
|
getStoriesState,
|
||||||
(hideStoryConversationIds, { lastOpenedAtTimestamp, stories }): number => {
|
(
|
||||||
|
storiesEnabled,
|
||||||
|
hideStoryConversationIds,
|
||||||
|
{ lastOpenedAtTimestamp, stories }
|
||||||
|
): number => {
|
||||||
|
if (!storiesEnabled) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const hiddenConversationIds = new Set(hideStoryConversationIds);
|
const hiddenConversationIds = new Set(hideStoryConversationIds);
|
||||||
|
|
||||||
return new Set(
|
return new Set(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue