|
@@ -592,19 +592,16 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
592
|
592
|
* @extends JitsiTrack#dispose
|
593
|
593
|
* @returns {Promise}
|
594
|
594
|
*/
|
595
|
|
- dispose() {
|
596
|
|
- let promise = Promise.resolve();
|
|
595
|
+ async dispose() {
|
597
|
596
|
|
598
|
597
|
// Remove the effect instead of stopping it so that the original stream is restored
|
599
|
598
|
// on both the local track and on the peerconnection.
|
600
|
599
|
if (this._streamEffect) {
|
601
|
|
- promise = this.setEffect();
|
|
600
|
+ await this.setEffect();
|
602
|
601
|
}
|
603
|
602
|
|
604
|
|
- let removeTrackPromise = Promise.resolve();
|
605
|
|
-
|
606
|
603
|
if (this.conference) {
|
607
|
|
- removeTrackPromise = this.conference.removeTrack(this);
|
|
604
|
+ await this.conference.removeTrack(this);
|
608
|
605
|
}
|
609
|
606
|
|
610
|
607
|
if (this.stream) {
|
|
@@ -619,7 +616,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
619
|
616
|
this._onAudioOutputDeviceChanged);
|
620
|
617
|
}
|
621
|
618
|
|
622
|
|
- return Promise.allSettled([ promise, removeTrackPromise ]).then(() => super.dispose());
|
|
619
|
+ return super.dispose();
|
623
|
620
|
}
|
624
|
621
|
|
625
|
622
|
/**
|