@@ -973,6 +973,7 @@ extension ChatListViewController {
973
973
) { [ weak self] in
974
974
guard let self else { return }
975
975
976
+ self . updateSelectedRow ( chatroom: chatroom)
976
977
self . presentChatroom ( chatroom, with: transaction. chatMessageId)
977
978
}
978
979
}
@@ -1602,13 +1603,7 @@ extension ChatListViewController: UISearchBarDelegate, UISearchResultsUpdating,
1602
1603
return
1603
1604
}
1604
1605
1605
- if let indexPath = tableView. indexPathForSelectedRow {
1606
- tableView. deselectRow ( at: indexPath, animated: true )
1607
- }
1608
-
1609
- if let indexPath = self ? . chatsController? . indexPath ( forObject: chatroom) {
1610
- tableView. selectRow ( at: indexPath, animated: true , scrollPosition: . none)
1611
- }
1606
+ self ? . updateSelectedRow ( chatroom: chatroom)
1612
1607
1613
1608
presenter. presentChatroom ( chatroom, with: message. transactionId)
1614
1609
}
@@ -1620,13 +1615,7 @@ extension ChatListViewController: UISearchBarDelegate, UISearchResultsUpdating,
1620
1615
return
1621
1616
}
1622
1617
1623
- if let indexPath = tableView. indexPathForSelectedRow {
1624
- tableView. deselectRow ( at: indexPath, animated: true )
1625
- }
1626
-
1627
- if let indexPath = self ? . chatsController? . indexPath ( forObject: chatroom) {
1628
- tableView. selectRow ( at: indexPath, animated: true , scrollPosition: . none)
1629
- }
1618
+ self ? . updateSelectedRow ( chatroom: chatroom)
1630
1619
1631
1620
presenter. presentChatroom ( chatroom)
1632
1621
}
@@ -1636,6 +1625,15 @@ extension ChatListViewController: UISearchBarDelegate, UISearchResultsUpdating,
1636
1625
account. chatroom? . isForcedVisible = true
1637
1626
newChatController ( didSelectAccount: account, preMessage: nil , name: nil )
1638
1627
}
1628
+
1629
+ func updateSelectedRow( chatroom: Chatroom ) {
1630
+ if let indexPath = tableView. indexPathForSelectedRow {
1631
+ tableView. deselectRow ( at: indexPath, animated: true )
1632
+ }
1633
+ if let indexPath = self . chatsController? . indexPath ( forObject: chatroom) {
1634
+ tableView. selectRow ( at: indexPath, animated: true , scrollPosition: . none)
1635
+ }
1636
+ }
1639
1637
}
1640
1638
1641
1639
// MARK: Mac OS HotKeys
0 commit comments