From b0a13e01238c9e2acc2a85bd16446aed9b7a6369 Mon Sep 17 00:00:00 2001 From: Monalisha Mishra Date: Wed, 29 May 2024 12:59:52 +0530 Subject: [PATCH] fixed the chatView list to chatview error --- src/modules/chat/ChatModule.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/chat/ChatModule.tsx b/src/modules/chat/ChatModule.tsx index 33c73d96f7..0c1af15dc5 100644 --- a/src/modules/chat/ChatModule.tsx +++ b/src/modules/chat/ChatModule.tsx @@ -58,7 +58,6 @@ function Chat({ chatid }) { // Check if the URL ends with '/chat' and does not include a chat ID const isUserChatting = pathname.endsWith('/chat') && !pathname.includes('::chatid'); - const { account, provider } = useAccount(); const { videoCallData } = useContext(VideoCallContext); @@ -199,6 +198,11 @@ function Chat({ chatid }) { if (userPushSDKInstance?.readmode()) showModal(); }, [userPushSDKInstance]); + // For setting selected chat id to empty string when none of the chat is open + useEffect(() => { + setSelectedChatId(''); + }, [pathname]); + // For setting selected chat id useEffect(() => { let formattedchatId = selectedChatId || chatid;