fix: phần code build

This commit is contained in:
2026-06-27 17:51:19 +07:00
parent 796487ef76
commit 614054f35d
-8
View File
@@ -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<MemberDashboardProps> = ({
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<MemberDashboardProps> = ({
// 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