Almost running

- NEVER use undefined as the default for behaviors (FOOTGUN)
This commit is contained in:
Timo K
2025-11-07 12:32:29 +01:00
parent 92fdce33ea
commit 28047217b8
13 changed files with 83 additions and 34 deletions

View File

@@ -111,7 +111,7 @@ export class UserMedia {
private readonly presenter$ = this.scope.behavior(
this.participant$.pipe(
switchMap((p) => (p === undefined ? of(false) : sharingScreen$(p))),
switchMap((p) => (p === null ? of(false) : sharingScreen$(p))),
),
);
@@ -151,7 +151,7 @@ export class UserMedia {
private readonly initialParticipant:
| LocalParticipant
| RemoteParticipant
| undefined,
| null = null,
private readonly encryptionSystem: EncryptionSystem,
private readonly livekitRoom: LivekitRoom,
private readonly focusURL: string,
@@ -163,7 +163,7 @@ export class UserMedia {
) {}
public updateParticipant(
newParticipant: LocalParticipant | RemoteParticipant | undefined,
newParticipant: LocalParticipant | RemoteParticipant | null = null,
): void {
if (this.participant$.value !== newParticipant) {
// Update the BehaviourSubject in the UserMedia.