From 5becd2e1757e79e1c10bdb20f117ea48e2ecc4a4 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 26 Jul 2024 06:51:09 -0400 Subject: [PATCH] Fix a crash when using the duplicate tiles option (#2512) --- src/state/CallViewModel.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index 35290140..3cb6ab27 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -596,7 +596,12 @@ export class CallViewModel extends ViewModel { return combineLatest( [this.grid, this.spotlight, this.screenShares], (grid, spotlight, screenShares): Layout => - grid.length == 2 && screenShares.length === 0 + grid.length == 2 && + // There might not be a remote tile if only the local user + // is in the call and they're using the duplicate tiles + // option + grid.some((vm) => !vm.local) && + screenShares.length === 0 ? { type: "one-on-one", local: grid.find(