wildfirechat / hm-chat

野火IM鸿蒙原生平台Demo
Other
27 stars 7 forks source link

消息列表有发送失败的消息,再新发送信息不会添加到消息列表。 #32

Closed captain-miao closed 1 month ago

captain-miao commented 1 month ago
  1. 有发送失败的消息,存在 message.messageUid = 0 的消息。
  2. 新发送消息,message.messageUid = 0
  3. appendMessage 提前返回了,没有添加到列表

https://github.com/wildfirechat/hm-chat/blob/891e2f117c898592ee42ed78efbd77f26fc443ae/uikit/src/main/ets/pages/conversation/ConversationPage.ets#L808

appendMessage(message: Message) {
        if (this.messages.findIndex(m => eq(m.messageUid, message.messageUid)) >= 0) {
            return
        }
        this.messages = this.messages.concat(message)
        this.notifyDataReload();
    }