From cd7ab00d8084c349316fb60d1ff676b11eb81aab Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Sun, 18 Jun 2023 11:45:01 -0400 Subject: [PATCH] Don't try to promote the same speaker multiple times --- src/video-grid/model.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/video-grid/model.ts b/src/video-grid/model.ts index 767ae19..646e534 100644 --- a/src/video-grid/model.ts +++ b/src/video-grid/model.ts @@ -690,8 +690,13 @@ export function promoteSpeakers(g: Grid) { for (let j = 0; j < 10; j++) { const to = Math.floor(Math.random() * firstPageEnd); const toCell = g.cells[to]; - if (toCell === undefined || (toCell.columns === 1 && toCell.rows === 1)) + if ( + toCell === undefined || + (toCell.columns === 1 && toCell.rows === 1) + ) { moveTile(g, from, to); + break; + } } } }