mirror of https://github.com/OpenVidu/openvidu.git
ov-components: refactor participant name retrieval logic in VideoconferenceComponent
parent
4ad8c52c38
commit
5df42d5344
|
@ -555,12 +555,6 @@ export class VideoconferenceComponent implements OnDestroy, AfterViewInit {
|
||||||
if (this.latestParticipantName) {
|
if (this.latestParticipantName) {
|
||||||
// We have a name, proceed immediately
|
// We have a name, proceed immediately
|
||||||
this._onReadyToJoin();
|
this._onReadyToJoin();
|
||||||
} else {
|
|
||||||
// Try to get it from storage first
|
|
||||||
const storedName = this.storageSrv.getParticipantName();
|
|
||||||
if (storedName) {
|
|
||||||
this.latestParticipantName = storedName;
|
|
||||||
this._onReadyToJoin();
|
|
||||||
} else {
|
} else {
|
||||||
// No name yet - set up a one-time subscription to wait for it
|
// No name yet - set up a one-time subscription to wait for it
|
||||||
const waitForNameSub = this.libService.participantName$
|
const waitForNameSub = this.libService.participantName$
|
||||||
|
@ -577,12 +571,16 @@ export class VideoconferenceComponent implements OnDestroy, AfterViewInit {
|
||||||
if (!this.latestParticipantName) {
|
if (!this.latestParticipantName) {
|
||||||
this.log.w('No participant name received after timeout, proceeding anyway');
|
this.log.w('No participant name received after timeout, proceeding anyway');
|
||||||
waitForNameSub.unsubscribe();
|
waitForNameSub.unsubscribe();
|
||||||
|
const storedName = this.storageSrv.getParticipantName();
|
||||||
|
if (storedName) {
|
||||||
|
this.latestParticipantName = storedName;
|
||||||
|
this.libService.setParticipantName(storedName);
|
||||||
|
}
|
||||||
this._onReadyToJoin();
|
this._onReadyToJoin();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// this.cd.markForCheck();
|
// this.cd.markForCheck();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue