|
@@ -449,7 +449,8 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
|
|
|
let newChat = Chat.getData(messageId: chatData[CoreMessage_TMessageKey.MESSAGE_ID] ?? "")
|
|
|
if newChat.count > 0 {
|
|
|
if indexChat != nil {
|
|
|
- chats[0] = newChat[0]
|
|
|
+ chats.remove(at: indexChat!)
|
|
|
+ chats.insert(newChat[0], at: 0)
|
|
|
let indexPathToMove = IndexPath(row: indexChat!, section: 0)
|
|
|
let indexPathNewPosition = IndexPath(row: 0, section: 0)
|
|
|
tableView.performBatchUpdates({
|
|
@@ -459,13 +460,8 @@ class SecondTabViewController: UIViewController, UIScrollViewDelegate, UIGesture
|
|
|
tableView.reloadRows(at: [IndexPath(row: 0, section: 0)], with: .none)
|
|
|
tableView.endUpdates()
|
|
|
} else {
|
|
|
- if noData {
|
|
|
- chats.insert(newChat[0], at: 0)
|
|
|
- tableView.reloadData()
|
|
|
- } else {
|
|
|
- chats.insert(newChat[0], at: 0)
|
|
|
- tableView.reloadData()
|
|
|
- }
|
|
|
+ chats.insert(newChat[0], at: 0)
|
|
|
+ tableView.reloadData()
|
|
|
}
|
|
|
}
|
|
|
}
|