From cd3a5a7fe6fb36dbc863754f01a2fa554f1b4a76 Mon Sep 17 00:00:00 2001 From: hahnlee Date: Tue, 29 Dec 2020 01:58:48 +0900 Subject: [PATCH 1/2] Remove unnecessary deps --- .../useScreenShareToggle/useScreenShareToggle.tsx | 2 +- src/state/useActiveSinkId/useActiveSinkId.ts | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx b/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx index 3da89957f..16ec481ca 100644 --- a/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx +++ b/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx @@ -57,7 +57,7 @@ export default function useScreenShareToggle(room: Room, onError: ErrorCallback) const toggleScreenShare = useCallback(() => { !isSharing ? shareScreen() : stopScreenShareRef.current(); - }, [isSharing, shareScreen, stopScreenShareRef]); + }, [isSharing, shareScreen]); return [isSharing, toggleScreenShare] as const; } diff --git a/src/state/useActiveSinkId/useActiveSinkId.ts b/src/state/useActiveSinkId/useActiveSinkId.ts index ed87c60ad..072732f0a 100644 --- a/src/state/useActiveSinkId/useActiveSinkId.ts +++ b/src/state/useActiveSinkId/useActiveSinkId.ts @@ -6,13 +6,10 @@ export default function useActiveSinkId() { const audioOutputDevices = useAudioOutputDevices(); const [activeSinkId, _setActiveSinkId] = useState('default'); - const setActiveSinkId = useCallback( - (sinkId: string) => { - window.localStorage.setItem(SELECTED_AUDIO_OUTPUT_KEY, sinkId); - _setActiveSinkId(sinkId); - }, - [_setActiveSinkId] - ); + const setActiveSinkId = useCallback((sinkId: string) => { + window.localStorage.setItem(SELECTED_AUDIO_OUTPUT_KEY, sinkId); + _setActiveSinkId(sinkId); + }, []); useEffect(() => { const selectedSinkId = window.localStorage.getItem(SELECTED_AUDIO_OUTPUT_KEY); From 2bdb3825b371c9d17525bc0843b41c4f5b4052ec Mon Sep 17 00:00:00 2001 From: Tim Mendoza Date: Mon, 24 May 2021 13:41:07 -0600 Subject: [PATCH 2/2] Remove unneeded dependency --- .../VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx b/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx index 9a3b3b66d..a66e91437 100644 --- a/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx +++ b/src/components/VideoProvider/useScreenShareToggle/useScreenShareToggle.tsx @@ -59,7 +59,7 @@ export default function useScreenShareToggle(room: Room | null, onError: ErrorCa if (room) { !isSharing ? shareScreen() : stopScreenShareRef.current(); } - }, [isSharing, shareScreen, stopScreenShareRef, room]); + }, [isSharing, shareScreen, room]); return [isSharing, toggleScreenShare] as const; }