diff --git a/Client/Frontend/Home/HomepageViewController.swift b/Client/Frontend/Home/HomepageViewController.swift index 7746e9ce724e..22d945c53d81 100644 --- a/Client/Frontend/Home/HomepageViewController.swift +++ b/Client/Frontend/Home/HomepageViewController.swift @@ -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() } @@ -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() } } }