stfalcon-studio/ChatKit

Adding message history through addToStart reverses messages' order

PvlBlk opened this issue · 0 comments

I'm loading history at the start of user interaction using addToStart method. My messages implement IMessage interface and have createdAt properly set up. Then I put messages into adapter like this:

messagesAdapter?.clear(true)
messagesAdapter?.addToEnd(chatState.data, false)

The end result is the most recent message is displayed at the top with oldest ones displayed at the bottom.
addToEnd(chatState.data, **true**)
Doesn't make a difference
Anyone faced this and can help me? Thanks in advance