Skip to content

Commit

Permalink
fix: clear timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala committed Jan 24, 2025
1 parent 2a7b9f7 commit 5d6fc97
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/calls-page/calls-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ export const CallsPage = () => {
setShouldReduceVolume(true);
}, 1000);
}
} else {
if (startTimeoutRef.current) {
clearTimeout(startTimeoutRef.current);
startTimeoutRef.current = null;
}
} else if (shouldReduceVolume) {
setShouldReduceVolume(false);
}

if (shouldReduceVolume) {
setShouldReduceVolume(false);
}
if (startTimeoutRef.current) {
clearTimeout(startTimeoutRef.current);
startTimeoutRef.current = null;
}
}, [isSomeoneSpeaking, shouldReduceVolume]);

Expand Down

0 comments on commit 5d6fc97

Please sign in to comment.