Skip to content

Commit

Permalink
Merge pull request #337 from Dongshanxu/master
Browse files Browse the repository at this point in the history
修复空消息问题 修复下拉消息重复问题
  • Loading branch information
shine2008 authored Jun 21, 2022
2 parents f46cf9d + 0e6e1ca commit fa61daf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,9 @@ extension ChatViewController {
print("dropDownRemoteRefresh messages count ", messages?.count as Any)

weakSelf?.tableView.reloadData()
weakSelf?.tableView.scrollToRow(at: IndexPath(row:count, section: 0), at: .top, animated: false)
if count>0 {
weakSelf?.tableView.scrollToRow(at: IndexPath(row:count, section: 0), at: .top, animated: false)
}
weakSelf?.tableView.mj_header?.endRefreshing()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ public class ChatViewModel: NSObject, ChatRepoMessageDelegate, NIMChatManagerDel
//查询更多本地历史消息
public func getMoreMessageHistory(_ completion: @escaping (Error?,NSInteger, [MessageModel]?) -> Void) {

if messages.count > 0 {
self.oldMsg = messages.last?.message
}
weak var weakSelf = self
ChatProvider.shared.getMessageHistory(session: self.session, message: self.oldMsg, limit: messagPageNum) { [weak self] error, messages in
if let messageArray = messages, messageArray.count > 0 {
Expand Down

0 comments on commit fa61daf

Please sign in to comment.