Fix thread messages grey

This commit is contained in:
Diego Mello 2022-11-29 16:43:25 -03:00
parent de6a897ec4
commit a593129a3c
2 changed files with 9 additions and 7 deletions

View File

@ -133,6 +133,8 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
hideSystemMessages = [];
}
const columnsToObserve = ['_updated_at', 'status'];
if (tmid) {
try {
this.thread = await db.get('threads').find(tmid);
@ -142,7 +144,7 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
this.messagesObservable = db
.get('thread_messages')
.query(Q.where('rid', tmid), Q.experimentalSortBy('ts', Q.desc), Q.experimentalSkip(0), Q.experimentalTake(this.count))
.observeWithColumns(['_updated_at']);
.observeWithColumns(columnsToObserve);
} else if (rid) {
const whereClause = [
Q.where('rid', rid),
@ -156,7 +158,7 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
this.messagesObservable = db
.get('messages')
.query(...whereClause)
.observeWithColumns(['_updated_at', 'status']);
.observeWithColumns(columnsToObserve);
}
if (rid) {
@ -171,7 +173,7 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
});
if (tmid && this.thread) {
data = [...messages, this.thread];
data = [...messages, this.thread.asPlain()];
}
/**
@ -347,7 +349,7 @@ class ListContainer extends React.Component<IListContainerProps, IListContainerS
scrollEventThrottle={16}
listRef={listRef}
data={messages}
extraData={loading}
extraData={loading || messages}
// @ts-ignore
renderItem={this.renderItem}
onEndReached={this.onEndReached}

View File

@ -393,7 +393,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'];
const columnsToObserve = ['alert', 'f', 'on_hold', 'room_updated_at'];
if (sortBy === SortBy.Alphabetical) {
defaultWhereClause.push(Q.experimentalSortBy(`${this.useRealName ? 'fname' : 'name'}`, Q.asc));
@ -406,14 +406,14 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
observable = await db
.get('subscriptions')
.query(...defaultWhereClause)
.observeWithColumns(observeColumns);
.observeWithColumns(columnsToObserve);
// 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(observeColumns);
.observeWithColumns(columnsToObserve);
}
this.querySubscription = observable.subscribe(data => {