Skip to content

Commit

Permalink
Made sure we are doing UI updates in ProgressCollectionViewController…
Browse files Browse the repository at this point in the history
… in main queue
  • Loading branch information
marbetschar committed Mar 2, 2020
1 parent 23eba9b commit 4376ba7
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,18 @@ open class ProgressCollectionViewController: UICollectionViewController, UIColle
}

guard let allReports = allReports else {
strongSelf.collectionView.reloadData()
DispatchQueue.main.async {
strongSelf.collectionView.reloadData()
}
completionHandler?(nil)
return
}
strongSelf.allReports = allReports

strongSelf.collectionView.reloadData()
strongSelf.collectionView.backgroundView?.isHidden = false == self?.allReports.first?.isEmpty
DispatchQueue.main.async {
strongSelf.collectionView.reloadData()
strongSelf.collectionView.backgroundView?.isHidden = false == self?.allReports.first?.isEmpty
}
completionHandler?(nil)
}
})
Expand Down

0 comments on commit 4376ba7

Please sign in to comment.