fix: phần code build
This commit is contained in:
@@ -4,7 +4,6 @@ import React, { useEffect, useState, useRef } from 'react';
|
|||||||
import { io, Socket } from 'socket.io-client';
|
import { io, Socket } from 'socket.io-client';
|
||||||
import { Capacitor } from '@capacitor/core';
|
import { Capacitor } from '@capacitor/core';
|
||||||
import { BACKEND_URL } from '@/utils/backendEndpoint';
|
import { BACKEND_URL } from '@/utils/backendEndpoint';
|
||||||
>>>>>>> Stashed changes
|
|
||||||
import {
|
import {
|
||||||
Compass,
|
Compass,
|
||||||
Users,
|
Users,
|
||||||
@@ -541,12 +540,6 @@ export const MemberDashboard: React.FC<MemberDashboardProps> = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!user?.id) return;
|
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
|
// Connect to WebSocket: absolute URL on native, relative (Vite proxy) on web
|
||||||
const socket = Capacitor.isNativePlatform()
|
const socket = Capacitor.isNativePlatform()
|
||||||
? io(BACKEND_URL)
|
? 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
|
// Check against window-global activeChatUserId so stale closure doesn't block updates
|
||||||
const activeChatUserId = (window as any).activeChatUserId;
|
const activeChatUserId = (window as any).activeChatUserId;
|
||||||
if (activeChatUserId && (message.senderId === activeChatUserId || message.receiverId === activeChatUserId)) {
|
if (activeChatUserId && (message.senderId === activeChatUserId || message.receiverId === activeChatUserId)) {
|
||||||
>>>>>>> Stashed changes
|
|
||||||
setChatMessages(prev => [...prev, message]);
|
setChatMessages(prev => [...prev, message]);
|
||||||
} else {
|
} else {
|
||||||
// Add to unread states
|
// Add to unread states
|
||||||
|
|||||||
Reference in New Issue
Block a user