Fix thread messages grey
This commit is contained in:
parent
de6a897ec4
commit
a593129a3c
|
@ -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}
|
||||
|
|
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue