Add removeEventListener on unmount

This commit is contained in:
Vitor Mateus 2019-06-10 16:29:58 -03:00
parent 272b1a3e30
commit b07cb6d15e

View File

@ -184,6 +184,8 @@ export default class WebcamDraggableOverlay extends Component {
});
document.removeEventListener('webcamFullscreenButtonChange', this.fullscreenButtonChange);
document.removeEventListener('videoListUsersChange', this.getVideoListUsersChange);
document.removeEventListener('videoFocusChange', this.eventVideoFocusChangeListener);
}
getVideoListUsersChange() {
@ -263,7 +265,6 @@ export default class WebcamDraggableOverlay extends Component {
const {
left: webcamLeft,
top: webcamTop,
height: webcamHeight,
} = webcamBySelectorRect;
const mediaContainerRect = mediaContainer.getBoundingClientRect();