Merge pull request #900 from mpretty-cyro/fix/media-detail-to-all-media-transition

Fixed an issue where tapping All Media on the media detail screen wasn't working
This commit is contained in:
Morgan Pretty 2023-09-08 10:28:58 +10:00 committed by GitHub
commit ab610578e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -469,8 +469,17 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou
// If the screen wasn't presented or it was presented from a location which isn't the
// MediaTileViewController then just pop/dismiss the screen
let parentNavController: UINavigationController? = {
switch self.presentingViewController {
case let topBannerController as TopBannerController:
return topBannerController.children.first as? UINavigationController
default: return self.presentingViewController as? UINavigationController
}
}()
guard
let presentingNavController: UINavigationController = (self.presentingViewController as? UINavigationController),
let presentingNavController: UINavigationController = parentNavController,
!(presentingNavController.viewControllers.last is AllMediaViewController)
else {
guard self.navigationController?.viewControllers.count == 1 else {