Merge pull request #19996 from ramonlsouza/fix-grid-pagination-loop

fix: grid mode loop when pagination is active
This commit is contained in:
Ramón Souza 2024-04-12 13:46:48 -03:00 committed by GitHub
commit 32d06f1d85
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -530,30 +530,11 @@ class VideoService {
}
getGridUsers(users, streams) {
const pageSize = this.getMyPageSize();
const isPaginationDisabled = !this.isPaginationEnabled() || pageSize === 0;
const isGridEnabled = this.isGridEnabled();
let gridUsers = [];
if (isPaginationDisabled) {
if (isGridEnabled) {
const streamUsers = streams.map((stream) => stream.userId);
gridUsers = users.filter(
(user) => !user.loggedOut && !user.left && !streamUsers.includes(user.userId),
).map((user) => ({
isGridItem: true,
...user,
}));
}
return gridUsers;
}
const paginatedStreams = this.getVideoPage(streams, pageSize);
if (isGridEnabled) {
const streamUsers = paginatedStreams.map((stream) => stream.userId);
const streamUsers = streams.map((stream) => stream.userId);
gridUsers = users.filter(
(user) => !user.loggedOut && !user.left && !streamUsers.includes(user.userId),