Skip to content

Commit 41bed59

Browse files
authored
Read receipts selector fix (#5063)
* Fix chat selectors using read receipts from state * Change files
1 parent 93d0e04 commit 41bed59

4 files changed

Lines changed: 23 additions & 2 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Read receipt selector",
5+
"comment": "Fix chat selectors using read receipts from state",
6+
"packageName": "@azure/communication-react",
7+
"email": "79475487+mgamis-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Read receipt selector",
5+
"comment": "Fix chat selectors using read receipts from state",
6+
"packageName": "@azure/communication-react",
7+
"email": "79475487+mgamis-msft@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

packages/chat-component-bindings/src/baseSelectors.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export const getParticipants = (
4444
/**
4545
* @private
4646
*/
47-
export const getReadReceipts = (state: ChatClientState, props: ChatBaseSelectorProps): ChatMessageReadReceipt[] => {
47+
export const getReadReceipts = (
48+
state: ChatClientState,
49+
props: ChatBaseSelectorProps
50+
): ChatMessageReadReceipt[] | undefined => {
4851
return state.threads[props?.threadId]?.readReceipts;
4952
};
5053

packages/chat-component-bindings/src/messageThreadSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ const hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean =>
317317
export const messageThreadSelectorWithThread: () => MessageThreadSelector = () =>
318318
createSelector(
319319
[getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants],
320-
(userId, chatMessages, latestReadTime, isLargeGroup, readReceipts, participants) => {
320+
(userId, chatMessages, latestReadTime, isLargeGroup, readReceipts = [], participants) => {
321321
// We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop
322322
const isTeamsInterop = Object.values(participants).find((p) => 'microsoftTeamsUserId' in p.id) !== undefined;
323323

0 commit comments

Comments
 (0)