ui: fix messages sort

This commit is contained in:
undefined committed 2022-07-10 16:58:37 +08:00
1 parent d53d0c65e0
commit f30898ea31
3 files changed
+7 -6

No files matched your search

@@ -67,7 +67,9 @@ export default connect(mapStateToProps)(class MessagePadDialogueContentContainer
renderInner() {
if (this.props.activeId === null) return [];
return this.props.item.messages.map((msg) => (
const sorted = this.props.item.messages
.sort((msg1, msg2) => parseMongoId(msg1._id).timestamp - parseMongoId(msg2._id).timestamp);
return sorted.map((msg) => (
<Message
key={msg._id}
isSelf={msg.from === UserContext._id}