Skip to content

Commit

Permalink
fix: solved issue with missing dependency (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 authored Jan 28, 2025
1 parent 884aeb7 commit 0dd2805
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/calls-page/calls-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,21 @@ export const CallsPage = () => {
}, [selectedProductionId]);

useEffect(() => {
let newGlobalMute = customGlobalMute;

Object.entries(calls).forEach(([, callState]) => {
if (
callState.hotkeys?.globalMuteHotkey &&
callState.hotkeys.globalMuteHotkey !== customGlobalMute
callState.hotkeys.globalMuteHotkey !== newGlobalMute
) {
setCustomGlobalMute(callState.hotkeys.globalMuteHotkey);
newGlobalMute = callState.hotkeys.globalMuteHotkey;
}
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [calls]);

if (newGlobalMute !== customGlobalMute) {
setCustomGlobalMute(newGlobalMute);
}
}, [calls, customGlobalMute]);

useEffect(() => {
if (isEmpty && !paramProductionId && !paramLineId) {
Expand Down

0 comments on commit 0dd2805

Please sign in to comment.