Local user should never be in the spotlight (#1125)

* Local user should never be in spotlight
This commit is contained in:
Enrico Schwendig 2023-06-21 14:51:41 +02:00 committed by GitHub
parent 413a311159
commit 6dbfb289eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -750,6 +750,7 @@ function reorderTiles<T>(tiles: Tile<T>[], layout: Layout, displayedTile = -1) {
const orderedTiles: Tile<T>[] = new Array(tiles.length);
tiles.forEach((tile) => (orderedTiles[tile.order] = tile));
let firstLocalTile: Tile<T> | undefined;
orderedTiles.forEach((tile) => {
if (tile.focused) {
focusedTiles.push(tile);
@ -758,12 +759,28 @@ function reorderTiles<T>(tiles: Tile<T>[], layout: Layout, displayedTile = -1) {
} else if (tile.isSpeaker && displayedTile < tile.order) {
speakerTiles.push(tile);
} else if (tile.hasVideo) {
onlyVideoTiles.push(tile);
if (tile.order === 0 && tile.item.local) {
firstLocalTile = tile;
} else {
onlyVideoTiles.push(tile);
}
} else {
otherTiles.push(tile);
if (tile.order === 0 && tile.item.local) {
firstLocalTile = tile;
} else {
otherTiles.push(tile);
}
}
});
if (firstLocalTile) {
if (firstLocalTile.hasVideo) {
onlyVideoTiles.push(firstLocalTile);
} else {
otherTiles.push(firstLocalTile);
}
}
[
...focusedTiles,
...presenterTiles,