Skip to content

Commit fbd50ed

Browse files
committed
fix: read receipts not updating in real-time
1 parent 231250c commit fbd50ed

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

packages/uikit-chat-hooks/src/common/useMessageOutgoingStatus.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { useGroupChannelHandler } from '@sendbird/uikit-tools';
12
import type { SendbirdChatSDK, SendbirdGroupChannel, SendbirdMessage } from '@sendbird/uikit-utils';
2-
import { isDifferentChannel, isMyMessage, useForceUpdate, useUniqHandlerId } from '@sendbird/uikit-utils';
3+
import { isDifferentChannel, isMyMessage, useForceUpdate } from '@sendbird/uikit-utils';
34

4-
import { useChannelHandler } from '../handler/useChannelHandler';
55
import { useAppFeatures } from './useAppFeatures';
66

77
export type SBUOutgoingStatus = 'NONE' | 'PENDING' | 'FAILED' | 'UNDELIVERED' | 'DELIVERED' | 'UNREAD' | 'READ';
@@ -14,19 +14,17 @@ export const useMessageOutgoingStatus = (
1414
const features = useAppFeatures(sdk);
1515
const forceUpdate = useForceUpdate();
1616
const currentUser = sdk.currentUser;
17-
const handlerId = useUniqHandlerId('useMessageOutgoingStatus');
1817

19-
useChannelHandler(sdk, handlerId, {
18+
useGroupChannelHandler(sdk, {
2019
onUndeliveredMemberStatusUpdated(eventChannel) {
2120
if (isDifferentChannel(channel, eventChannel)) return;
2221
if (!isMyMessage(message, currentUser?.userId)) return;
2322

2423
forceUpdate();
2524
},
26-
onUnreadMemberStatusUpdated(eventChannel) {
25+
onUserMarkedRead(eventChannel) {
2726
if (isDifferentChannel(channel, eventChannel)) return;
2827
if (!isMyMessage(message, currentUser?.userId)) return;
29-
3028
forceUpdate();
3129
},
3230
});

packages/uikit-react-native/src/domain/groupChannel/component/GroupChannelMessageList.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ const GroupChannelMessageList = (props: GroupChannelProps['MessageList']) => {
256256
lazyScrollToBottom({ animated: true, timeout: 250 });
257257
}
258258
},
259-
onChannelChanged(channel) {
260-
if (isDifferentChannel(channel, props.channel)) return;
261-
},
262259
});
263260

264261
useEffect(() => {

0 commit comments

Comments
 (0)