This commit is contained in:
Diego Mello 2022-11-28 18:38:51 -03:00
parent f67a4010bc
commit 7beaa62003
1 changed files with 3 additions and 2 deletions

View File

@ -392,6 +392,7 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
let observable;
const defaultWhereClause = [Q.where('archived', false), Q.where('open', true)] as (Q.WhereDescription | Q.SortBy)[];
const observeColumns = ['alert', 'f', 'on_hold', 'room_updated_at'];
if (sortBy === SortBy.Alphabetical) {
defaultWhereClause.push(Q.experimentalSortBy(`${this.useRealName ? 'fname' : 'name'}`, Q.asc));
@ -404,14 +405,14 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
observable = await db
.get('subscriptions')
.query(...defaultWhereClause)
.observeWithColumns(['alert', 'on_hold', 'room_updated_at']);
.observeWithColumns(observeColumns);
// When we're NOT grouping
} else {
this.count += QUERY_SIZE;
observable = await db
.get('subscriptions')
.query(...defaultWhereClause, Q.experimentalSkip(0), Q.experimentalTake(this.count))
.observeWithColumns(['alert', 'on_hold', 'room_updated_at']);
.observeWithColumns(observeColumns);
}
this.querySubscription = observable.subscribe(data => {