diff --git a/src/state/media/UserMediaViewModel.ts b/src/state/media/UserMediaViewModel.ts index 58fd353ef..fb664f0bb 100644 --- a/src/state/media/UserMediaViewModel.ts +++ b/src/state/media/UserMediaViewModel.ts @@ -102,9 +102,9 @@ export function createBaseUserMedia( scope.behavior( combineLatest([participant$, showConnectionStats.value$]).pipe( switchMap(([p, showConnectionStats]) => - !p || !showConnectionStats - ? of(undefined) - : observeRtpStreamStats$(p, source, statsType), + p && showConnectionStats + ? observeRtpStreamStats$(p, source, statsType) + : of(undefined), ), ), );