change structure socket and add permission
This commit is contained in:
@@ -33,7 +33,7 @@ const CallHistory = ({ tab }) => {
|
||||
<ErrorOrEmpty isErrorOrEmpty="empty" />
|
||||
) : (
|
||||
<Box>
|
||||
<ListItemOfCalls historyItem={firstItemOfHistory} />
|
||||
<ListItemOfCalls key={'first'} historyItem={firstItemOfHistory} />
|
||||
{historyList && (
|
||||
<Divider>
|
||||
<Chip
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user