From 893ff61875ba57253cc6e8118a321fbb5af472a5 Mon Sep 17 00:00:00 2001 From: amar-1995 Date: Wed, 27 Mar 2024 12:12:05 +0530 Subject: [PATCH 1/4] fix: scroll to latest chat message --- .../roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx index 51f51f2123..d1512453e0 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx @@ -118,7 +118,7 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo inputRef.current.value = ''; setTimeout(() => { onSend(1); - }, 0); + }, 200); } catch (error) { const err = error as HMSException; ToastManager.addToast({ From 0dd7a9ca5682057b907d282ede833743609e8a80 Mon Sep 17 00:00:00 2001 From: amar-1995 Date: Wed, 27 Mar 2024 12:37:54 +0530 Subject: [PATCH 2/4] fix: update message directly to store iwth batch --- .../hms-video-store/src/reactive-store/HMSSDKActions.ts | 6 +++++- .../src/Prebuilt/components/Chat/ChatFooter.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts index 5fc292b07b..d0a9fff5cf 100644 --- a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts +++ b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts @@ -429,7 +429,11 @@ export class HMSSDKActions { + store.messages.byID[hmsMessage.id] = hmsMessage; + store.messages.allIDs.push(hmsMessage.id); + }, 'newMessage'); } setMessageRead(readStatus: boolean, messageId?: string) { diff --git a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx index d1512453e0..51f51f2123 100644 --- a/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/Chat/ChatFooter.tsx @@ -118,7 +118,7 @@ export const ChatFooter = ({ onSend, children }: { onSend: (count: number) => vo inputRef.current.value = ''; setTimeout(() => { onSend(1); - }, 200); + }, 0); } catch (error) { const err = error as HMSException; ToastManager.addToast({ From b271e280f7ac5b52c27ad9e3636cc7b87e27c4c0 Mon Sep 17 00:00:00 2001 From: amar-1995 Date: Wed, 27 Mar 2024 14:19:15 +0530 Subject: [PATCH 3/4] fix: ignore message shouldn't be in store --- packages/hms-video-store/src/reactive-store/HMSSDKActions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts index d0a9fff5cf..6cd6efc9cc 100644 --- a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts +++ b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts @@ -415,6 +415,9 @@ export class HMSSDKActions Date: Wed, 27 Mar 2024 15:10:37 +0530 Subject: [PATCH 4/4] fix: ignored check --- packages/hms-video-store/src/reactive-store/HMSSDKActions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts index 6cd6efc9cc..bd78ee79ee 100644 --- a/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts +++ b/packages/hms-video-store/src/reactive-store/HMSSDKActions.ts @@ -415,7 +415,8 @@ export class HMSSDKActions {