Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the chatPreview list to chatview error #1588

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/modules/chat/ChatModule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Loading