ov-components: refactor participant name retrieval logic in VideoconferenceComponent

master
Carlos Santos 2025-05-20 12:40:22 +02:00
parent 4ad8c52c38
commit 5df42d5344
1 changed files with 22 additions and 24 deletions

View File

@ -555,12 +555,6 @@ export class VideoconferenceComponent implements OnDestroy, AfterViewInit {
if (this.latestParticipantName) {
// We have a name, proceed immediately
this._onReadyToJoin();
} else {
// Try to get it from storage first
const storedName = this.storageSrv.getParticipantName();
if (storedName) {
this.latestParticipantName = storedName;
this._onReadyToJoin();
} else {
// No name yet - set up a one-time subscription to wait for it
const waitForNameSub = this.libService.participantName$
@ -577,12 +571,16 @@ export class VideoconferenceComponent implements OnDestroy, AfterViewInit {
if (!this.latestParticipantName) {
this.log.w('No participant name received after timeout, proceeding anyway');
waitForNameSub.unsubscribe();
const storedName = this.storageSrv.getParticipantName();
if (storedName) {
this.latestParticipantName = storedName;
this.libService.setParticipantName(storedName);
}
this._onReadyToJoin();
}
}, 1000);
}
}
}
// this.cd.markForCheck();
});