refactor: update backend URL and added conveyor event storing in ackend

This commit is contained in:
2025-04-01 14:25:42 +05:30
parent 6f483baf8d
commit 526befad20
20 changed files with 173 additions and 72 deletions

View File

@@ -32,7 +32,7 @@ const CamModelsGroup = () => {
if (!socket) return;
const organization = email!.split("@")[1].split(".")[0];
socket.on("userConnectRespones", (data: any) => {
socket.on("userConnectResponse", (data: any) => {
if (!groupRef.current) return;
if (data.data.userData.email === email) return;
if (socket.id === data.socketId || organization !== data.organization)
@@ -64,7 +64,11 @@ const CamModelsGroup = () => {
});
});
socket.on("userDisConnectRespones", (data: any) => {
// socket.on("users:online", (data: any) => {
// console.log('users online: ', data);
// })
socket.on("userDisConnectResponse", (data: any) => {
if (!groupRef.current) return;
if (socket.id === data.socketId || organization !== data.organization)
return;
@@ -109,6 +113,15 @@ const CamModelsGroup = () => {
};
}, [socket, activeUsers]);
// useEffect(() => {
// console.log(activeUsers);
// }, [activeUsers])
// useEffect(() => {
// console.log(models);
// }, [models])
useFrame(() => {
if (!groupRef.current) return;
Object.keys(models).forEach((uuid) => {
@@ -142,7 +155,7 @@ const CamModelsGroup = () => {
const filteredData = data.cameraDatas.filter(
(camera: any) => camera.userData.email !== email
);
let a:any = [];
let a: any = [];
if (filteredData.length > 0) {
loader.load(camModel, (gltf) => {
const newCams = filteredData.map((cam: any) => {