Skip to content

Commit

Permalink
fix qualityIndicator listener
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith authored Nov 21, 2024
1 parent 1b7cca9 commit 52100bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/rtpquality/QualityIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ const QualityIndicator = (): JSX.Element => {
}

const detector = monitor.createCongestionDetector();

detector.on('alert-state', (state) => setDistorted(state === 'on'));
const listener = (state) => setDistorted(state === 'on');

Check failure on line 21 in src/components/rtpquality/QualityIndicator.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Parameter 'state' implicitly has an 'any' type.

detector.on('alert-state', listener);

return () => {
if (!monitor) {
return;
}
detector.on('alert-state', (state) => setDistorted(state === 'on'));

detector.off('alert-state', listener);
};
}, []);

Expand Down

0 comments on commit 52100bb

Please sign in to comment.