Skip to content

Commit

Permalink
fix: change back muteoutout
Browse files Browse the repository at this point in the history
  • Loading branch information
Saelmala committed Jan 17, 2025
1 parent c835154 commit 29ff277
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/components/production-line/production-line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,15 @@ export const ProductionLine = ({
}
}, [connectionState, playEnterSound]);

const muteOutput = useCallback(
(isMuted: boolean) => {
if (!audioElements) return;
const muteOutput = useCallback(() => {
if (!audioElements) return;

audioElements.forEach((singleElement: HTMLAudioElement) => {
// eslint-disable-next-line no-param-reassign
singleElement.muted = isMuted;
});
setIsOutputMuted(isMuted);
},
[audioElements, setIsOutputMuted]
);
audioElements.forEach((singleElement: HTMLAudioElement) => {
// eslint-disable-next-line no-param-reassign
singleElement.muted = !isOutputMuted;
});
setIsOutputMuted(!isOutputMuted);
}, [audioElements, isOutputMuted]);

useSpeakerHotkeys({
muteOutput,
Expand Down Expand Up @@ -718,7 +715,7 @@ export const ProductionLine = ({
>
<UserControlBtn
type="button"
onClick={() => muteOutput(!isOutputMuted)}
onClick={() => muteOutput()}
disabled={value === 0}
>
<ButtonIcon
Expand Down

0 comments on commit 29ff277

Please sign in to comment.