mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Local user should never be in the spotlight (#1125)
* Local user should never be in spotlight
This commit is contained in:
parent
413a311159
commit
6dbfb289eb
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user