Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bugfix FXIOS-5123 [v106.1] Change order of operations for reloading homepage #12224

Merged
merged 3 commits into from
Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Client/Frontend/Home/HomepageViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ class HomepageViewController: UIViewController, HomePanel, FeatureFlaggable {

// Force the entire collectionview to re-layout
viewModel.refreshData(for: traitCollection)
collectionView.reloadData()
collectionView.collectionViewLayout.invalidateLayout()

// This pushes a reload to the end of the main queue after all the work associated with
// rotating has been completed. This is important because some of the cells layout are
// based on the screen state
DispatchQueue.main.async {
self.collectionView.reloadData()
}
Expand Down Expand Up @@ -759,8 +764,8 @@ extension HomepageViewController: HomepageViewModelDelegate {
guard let self = self else { return }

self.viewModel.refreshData(for: self.traitCollection)
self.collectionView.collectionViewLayout.invalidateLayout()
self.collectionView.reloadData()
self.collectionView.collectionViewLayout.invalidateLayout()
}
}
}
Expand Down