fix ordering of message with more recent at bottom of the view

This commit is contained in:
Audric Ackermann 2020-10-16 15:12:41 +11:00
parent 3998bbc97d
commit b1cac5f01b
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
2 changed files with 4 additions and 5 deletions

View File

@ -79,6 +79,7 @@
flex-grow: 1;
align-items: center;
justify-content: center;
width: 100%;
}
.message-selection-overlay {

View File

@ -285,7 +285,7 @@ export class SessionConversation extends React.Component<Props, State> {
}
);
const messages = messageSet.models;
const messages = messageSet.models.reverse();
const messageFetchTimestamp = Date.now();
this.setState({ messages, messageFetchTimestamp }, () => {
@ -299,9 +299,7 @@ export class SessionConversation extends React.Component<Props, State> {
fetchInterval = Constants.CONVERSATION.MESSAGE_FETCH_INTERVAL
) {
const { conversationKey, messageFetchTimestamp } = this.state;
const conversationModel = window.ConversationController.get(
conversationKey
);
const timestamp = getTimestamp();
// If we have pulled messages in the last interval, don't bother rescanning
@ -326,7 +324,7 @@ export class SessionConversation extends React.Component<Props, State> {
);
// Set first member of series here.
const messageModels = messageSet.models;
const messageModels = messageSet.models.reverse();
const messages = [];
let previousSender;
for (let i = 0; i < messageModels.length; i++) {