fix(tracks): remove mute and videotype listeners on track remove

Listeners were set for when a track muted or changed its video
type, but the listeners were never removed. This would could
cause events to keep firing on the removed tracks, which would
cause redux to fire and error because the tracks were no longer
known. That the tracks still fire events after removal is
another issue...
This commit is contained in:
Leonard Kim 2017-07-12 15:49:11 -07:00 committed by Paweł Domas
parent 884509faee
commit 4eacbd9f61
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,9 @@ export function trackMutedChanged(track) {
* @returns {{ type: TRACK_REMOVED, track: Track }}
*/
export function trackRemoved(track) {
track.removeAllListeners(JitsiTrackEvents.TRACK_MUTE_CHANGED);
track.removeAllListeners(JitsiTrackEvents.TRACK_VIDEOTYPE_CHANGED);
return {
type: TRACK_REMOVED,
track: {