diff --git a/src/components/Room/useRoom.ts b/src/components/Room/useRoom.ts index 9a12a63..d93ed46 100644 --- a/src/components/Room/useRoom.ts +++ b/src/components/Room/useRoom.ts @@ -52,8 +52,6 @@ export function useRoom( ) const { - numberOfPeers, - setNumberOfPeers, peerList, setPeerList, tabHasFocus, @@ -279,9 +277,6 @@ export function useRoom( showAlert(`Someone has joined the room`, { severity: 'success', }) - - const newNumberOfPeers = numberOfPeers + 1 - setNumberOfPeers(newNumberOfPeers) ;(async () => { try { const promises: Promise[] = [ @@ -314,10 +309,6 @@ export function useRoom( } ) - const newNumberOfPeers = numberOfPeers - 1 - setNumberOfPeers(newNumberOfPeers) - setNumberOfPeers(newNumberOfPeers) - if (peerExist) { const peerListClone = [...peerList] peerListClone.splice(peerIndex, 1) diff --git a/src/components/Shell/Shell.tsx b/src/components/Shell/Shell.tsx index 8c7cb74..791ba32 100644 --- a/src/components/Shell/Shell.tsx +++ b/src/components/Shell/Shell.tsx @@ -61,7 +61,6 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { const [isFullscreen, setIsFullscreen] = useState(false) const [title, setTitle] = useState('') const [alertText, setAlertText] = useState('') - const [numberOfPeers, setNumberOfPeers] = useState(1) const [roomId, setRoomId] = useState(undefined) const [password, setPassword] = useState(undefined) const [isPeerListOpen, setIsPeerListOpen] = useState(defaultSidebarsOpen) @@ -88,9 +87,7 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { const shellContextValue = useMemo( () => ({ - numberOfPeers, tabHasFocus, - setNumberOfPeers, showRoomControls, setShowRoomControls, setTitle, @@ -122,10 +119,8 @@ export const Shell = ({ appNeedsUpdate, children, userPeerId }: ShellProps) => { setRoomId, password, setPassword, - numberOfPeers, peerList, tabHasFocus, - setNumberOfPeers, showRoomControls, setShowRoomControls, setTitle, diff --git a/src/contexts/ShellContext.ts b/src/contexts/ShellContext.ts index 5191c6a..d2589c2 100644 --- a/src/contexts/ShellContext.ts +++ b/src/contexts/ShellContext.ts @@ -4,9 +4,7 @@ import { AlertOptions } from 'models/shell' import { AudioState, ScreenShareState, VideoState, Peer } from 'models/chat' interface ShellContextProps { - numberOfPeers: number tabHasFocus: boolean - setNumberOfPeers: Dispatch> showRoomControls: boolean setShowRoomControls: Dispatch> setTitle: Dispatch> @@ -32,9 +30,7 @@ interface ShellContextProps { } export const ShellContext = createContext({ - numberOfPeers: 1, tabHasFocus: true, - setNumberOfPeers: () => {}, showRoomControls: false, setShowRoomControls: () => {}, setTitle: () => {},