Prevent race in status action account list

This commit is contained in:
Shadowfacts 2020-05-10 15:04:22 -04:00
parent b220948e2b
commit f4f2a5546c
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 5 additions and 4 deletions

View File

@ -82,7 +82,7 @@ class StatusActionAccountListTableViewController: EnhancedTableViewController {
let request = actionType == .favorite ? Status.getFavourites(status.id) : Status.getReblogs(status.id)
mastodonController.run(request) { (response) in
guard case let .success(accounts, _) = response else { fatalError() }
self.mastodonController.persistentContainer.addAll(accounts: accounts)
self.mastodonController.persistentContainer.addAll(accounts: accounts) {
DispatchQueue.main.async {
self.accountIDs = accounts.map { $0.id }
self.tableView.tableFooterView = nil
@ -90,6 +90,7 @@ class StatusActionAccountListTableViewController: EnhancedTableViewController {
}
}
}
}
// MARK: - Table view data source