Notification for failed story sends

This commit is contained in:
Josh Perez 2023-02-07 14:33:04 -05:00 committed by GitHub
parent 4c2f169783
commit e11f961d7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 3 deletions

View file

@ -576,3 +576,16 @@ export const getHasAllStoriesUnmuted = createSelector(
getStoriesState,
({ hasAllStoriesUnmuted }): boolean => hasAllStoriesUnmuted
);
export const getHasAnyFailedStorySends = createSelector(
getStoriesState,
({ lastOpenedAtTimestamp, stories }): boolean => {
return stories.some(
story =>
story.timestamp > (lastOpenedAtTimestamp || 0) &&
Object.values(story.sendStateByConversationId || {}).some(
({ status }) => status === SendStatus.Failed
)
);
}
);