fixed bug in refreshcontroller
Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
4f0d099f60
commit
b9bd3ae310
@ -112,7 +112,6 @@ class EmployeesViewController: UIViewController {
|
||||
.sink { [weak self] _ in
|
||||
self?.updateFooter()
|
||||
self?.tableView.reloadData()
|
||||
self?.tableView.refreshControl?.endRefreshing()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@ -123,6 +122,7 @@ class EmployeesViewController: UIViewController {
|
||||
self?.activityIndicator.startAnimating()
|
||||
} else {
|
||||
self?.activityIndicator.stopAnimating()
|
||||
self?.tableView.refreshControl?.endRefreshing() // End refresh control
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@ -65,13 +65,12 @@ public class EmployeesViewModel: ObservableObject {
|
||||
totalEmployees = wrapper.total
|
||||
currentPage = page
|
||||
hasMorePages = employees.count < totalEmployees
|
||||
isLoading = false
|
||||
|
||||
} catch {
|
||||
// Handle errors
|
||||
isLoading = false
|
||||
errorMessage = "An unexpected error occurred, please try to refresh."
|
||||
}
|
||||
|
||||
isLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user