diff --git a/frontend/src/pages/MemberDashboard.tsx b/frontend/src/pages/MemberDashboard.tsx index 0a6a0f7..5dc662b 100644 --- a/frontend/src/pages/MemberDashboard.tsx +++ b/frontend/src/pages/MemberDashboard.tsx @@ -4,7 +4,6 @@ import React, { useEffect, useState, useRef } from 'react'; import { io, Socket } from 'socket.io-client'; import { Capacitor } from '@capacitor/core'; import { BACKEND_URL } from '@/utils/backendEndpoint'; ->>>>>>> Stashed changes import { Compass, Users, @@ -541,12 +540,6 @@ export const MemberDashboard: React.FC = ({ useEffect(() => { if (!user?.id) return; -<<<<<<< Updated upstream - const handleMessageReceived = (e: Event) => { - const message = (e as CustomEvent).detail; - // If we are actively chatting with the sender of this message - if (activeChatUser && (message.senderId === activeChatUser.id || message.receiverId === activeChatUser.id)) { -======= // Connect to WebSocket: absolute URL on native, relative (Vite proxy) on web const socket = Capacitor.isNativePlatform() ? io(BACKEND_URL) @@ -562,7 +555,6 @@ export const MemberDashboard: React.FC = ({ // Check against window-global activeChatUserId so stale closure doesn't block updates const activeChatUserId = (window as any).activeChatUserId; if (activeChatUserId && (message.senderId === activeChatUserId || message.receiverId === activeChatUserId)) { ->>>>>>> Stashed changes setChatMessages(prev => [...prev, message]); } else { // Add to unread states