change structure socket and add permission

This commit is contained in:
AmirHossein Mahmoodi
2025-05-07 10:23:21 +03:30
parent e48e48d6bb
commit bc59952f7b
5 changed files with 21 additions and 18 deletions

View File

@@ -33,7 +33,7 @@ const CallHistory = ({ tab }) => {
<ErrorOrEmpty isErrorOrEmpty="empty" />
) : (
<Box>
<ListItemOfCalls historyItem={firstItemOfHistory} />
<ListItemOfCalls key={'first'} historyItem={firstItemOfHistory} />
{historyList && (
<Divider>
<Chip

View File

@@ -1,23 +1,9 @@
"use client";
import { CallProvider } from "@/lib/contexts/call";
import { CategoriesProvider } from "@/lib/contexts/category";
import { useSocket } from "@/lib/contexts/socket";
import { useEffect } from "react";
import CallWidgetDialog from "./CallWidgetDialog";
const CallWidget = () => {
const { socket, status } = useSocket();
useEffect(() => {
if (status == "connected") return;
socket.connect();
return () => {
socket.disconnect();
};
}, [socket]);
return (
<CategoriesProvider>
<CallProvider>