Glitchy room list header when scrolling

- fixed
This commit is contained in:
Gil Eluard
2022-09-01 16:56:18 +02:00
parent f8b0c61691
commit fcc1a8a404
18 changed files with 1415 additions and 214 deletions
@@ -95,15 +95,17 @@ class RoomInvitesViewController: RecentsViewController {
override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
super.tableView(tableView, willDisplay: cell, forRowAt: indexPath)
guard tableView.numberOfSections > indexPath.section else {
return
}
let numberOfRowsInSection = tableView.numberOfRows(inSection: indexPath.section)
guard indexPath.row == numberOfRowsInSection - 1 else {
return
}
tableViewPaginationThrottler .throttle { [weak self] in
guard let self = self, tableView.numberOfSections > indexPath.section else {
return
}
let numberOfRowsInSection = tableView.numberOfRows(inSection: indexPath.section)
if indexPath.row == numberOfRowsInSection - 1 {
self.recentsDataSource?.paginate(inSection: indexPath.section)
}
self?.recentsDataSource?.paginate(inSection: indexPath.section)
}
}