Force history messages to always be at the front of the messages array

This commit is contained in:
Gabe Kangas 2021-07-21 22:23:24 -07:00
parent 1d7b7727d2
commit e7e1758fa4

View File

@ -151,7 +151,7 @@ export default class Chat extends Component {
// extra user names
const chatUserNames = extraUserNamesFromMessageHistory(data);
this.setState({
messages: this.state.messages.concat(data),
messages: data.concat(this.state.messages),
chatUserNames,
});
this.scrollToBottom();