File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ function getRemoteAudioElement(): HTMLAudioElement {
118118export default class CallHandler {
119119 private calls = new Map < string , MatrixCall > ( ) ; // roomId -> call
120120 private audioPromises = new Map < AudioID , Promise < void > > ( ) ;
121+ private dispatcherRef : string ;
121122
122123 static sharedInstance ( ) {
123124 if ( ! window . mxCallHandler ) {
@@ -128,7 +129,7 @@ export default class CallHandler {
128129 }
129130
130131 start ( ) {
131- dis . register ( this . onAction ) ;
132+ this . dispatcherRef = dis . register ( this . onAction ) ;
132133 // add empty handlers for media actions, otherwise the media keys
133134 // end up causing the audio elements with our ring/ringback etc
134135 // audio clips in to play.
@@ -151,6 +152,7 @@ export default class CallHandler {
151152 if ( cli ) {
152153 cli . removeListener ( 'Call.incoming' , this . onCallIncoming ) ;
153154 }
155+ if ( this . dispatcherRef ) dis . unregister ( this . dispatcherRef ) ;
154156 }
155157
156158 private onCallIncoming = ( call ) => {
You can’t perform that action at this time.
0 commit comments