Fix bug loading conversation upsidedown
Sometimes a conversation's messages would be reverse-ordered on first load, correcting themselves after a refresh. This is an artifact of the order we load messages from the database. To fix, load them in the opposite order. The alternative solution would be to reset the collection every time we fetch new messages, but this would create an entirely new set of model objects each time, which seems unnecessary.
This commit is contained in:
parent
296dae544d
commit
1bdb42b67e
1 changed files with 1 additions and 2 deletions
|
@ -72,8 +72,7 @@
|
|||
// 'conversation' index on [conversationId, received_at]
|
||||
name : 'conversation',
|
||||
lower : [conversationId],
|
||||
upper : [conversationId, Number.MAX_VALUE],
|
||||
order : 'desc'
|
||||
upper : [conversationId, Number.MAX_VALUE]
|
||||
// SELECT messages WHERE conversationId = this.id ORDER
|
||||
// received_at DESC
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue