You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-11 17:57:29 +03:00
Fix MaxListenersExceededWarning (#7389)
This commit is contained in:
@@ -658,6 +658,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
callState: callState,
|
callState: callState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
CallHandler.instance.on(CallHandlerEvent.CallState, this.onCallState);
|
||||||
window.addEventListener('beforeunload', this.onPageUnload);
|
window.addEventListener('beforeunload', this.onPageUnload);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -675,7 +676,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
CallHandler.instance.addListener(CallHandlerEvent.CallState, this.onCallState);
|
|
||||||
if (this.roomView.current) {
|
if (this.roomView.current) {
|
||||||
const roomView = this.roomView.current;
|
const roomView = this.roomView.current;
|
||||||
if (!roomView.ondrop) {
|
if (!roomView.ondrop) {
|
||||||
@@ -769,6 +769,8 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CallHandler.instance.off(CallHandlerEvent.CallState, this.onCallState);
|
||||||
|
|
||||||
// cancel any pending calls to the throttled updated
|
// cancel any pending calls to the throttled updated
|
||||||
this.updateRoomMembers.cancel();
|
this.updateRoomMembers.cancel();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user