From 28878a0b121f0aedd6d0dd70cad00cfb94567ed4 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 4 Sep 2020 14:19:50 +0200 Subject: [PATCH] Fix Firefox indexedDB state change issue Firefox ignores the state change of the conf state after reloading --- .../components/jitsi/jitsi.component.ts | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/client/src/app/shared/components/jitsi/jitsi.component.ts b/client/src/app/shared/components/jitsi/jitsi.component.ts index a8bcdac7e..2fa2f09b7 100644 --- a/client/src/app/shared/components/jitsi/jitsi.component.ts +++ b/client/src/app/shared/components/jitsi/jitsi.component.ts @@ -315,26 +315,23 @@ export class JitsiComponent extends BaseViewComponent implements OnInit, OnDestr await this.configsLoaded; this.subscriptions.push( - this.storageMap - .watch(this.CONFERENCE_STATE_STORAGE_KEY) - .pipe(distinctUntilChanged()) - .subscribe((confState: ConferenceState) => { - if (confState in ConferenceState) { - if (this.enableJitsi && (!this.videoStreamUrl || !this.canSeeLiveStream)) { - this.currentState = ConferenceState.jitsi; - } else if (!this.enableJitsi && this.videoStreamUrl && this.canSeeLiveStream) { - this.currentState = ConferenceState.stream; - } else { - this.currentState = confState; - } + this.storageMap.watch(this.CONFERENCE_STATE_STORAGE_KEY).subscribe((confState: ConferenceState) => { + if (confState in ConferenceState) { + if (this.enableJitsi && (!this.videoStreamUrl || !this.canSeeLiveStream)) { + this.currentState = ConferenceState.jitsi; + } else if (!this.enableJitsi && this.videoStreamUrl && this.canSeeLiveStream) { + this.currentState = ConferenceState.stream; } else { - this.setDefaultConfState(); + this.currentState = confState; } - // show stream window when the state changes to stream - if (this.currentState === ConferenceState.stream && !this.streamActiveInAnotherTab) { - this.showJitsiWindow = true; - } - }), + } else { + this.setDefaultConfState(); + } + // show stream window when the state changes to stream + if (this.currentState === ConferenceState.stream && !this.streamActiveInAnotherTab) { + this.showJitsiWindow = true; + } + }), // check if the operator is on the clos, remove from room if not permitted this.closService.currentListOfSpeakersObservable .pipe(