2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

Show notification policy at full height if there are admin options included

Contributes to IOS-398
This commit is contained in:
shannon 2025-04-09 15:04:48 -04:00
parent b9a997dba9
commit 1ae72b9431
3 changed files with 5 additions and 5 deletions

View File

@ -151,7 +151,7 @@ extension SceneCoordinator {
case safariPresent(animated: Bool, completion: (() -> Void)? = nil)
case alertController(animated: Bool, completion: (() -> Void)? = nil)
case activityViewControllerPresent(animated: Bool, completion: (() -> Void)? = nil)
case formSheet
case formSheet([UISheetPresentationController.Detent]?)
case none
}
@ -357,10 +357,10 @@ extension SceneCoordinator {
viewController.modalPresentationCapturesStatusBarAppearance = true
presentingViewController.present(viewController, animated: animated, completion: completion)
case .formSheet:
case .formSheet(let detents):
viewController.modalPresentationStyle = .formSheet
if let sheetPresentation = viewController.sheetPresentationController {
sheetPresentation.detents = [.large(), .medium()]
sheetPresentation.detents = detents ?? [.medium(), .large()]
}
presentingViewController.present(viewController, animated: true)
}

View File

@ -85,7 +85,7 @@ class NotificationListViewController: UIHostingController<NotificationListView>
adminSettings: adminSettings
)
guard let policyViewController = self.sceneCoordinator?.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet) as? NotificationPolicyViewController else { return }
guard let policyViewController = self.sceneCoordinator?.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet(policyViewModel.adminFilterSettings != nil ? [.large()] : nil)) as? NotificationPolicyViewController else { return }
policyViewController.delegate = self
}

View File

@ -320,7 +320,7 @@ extension MainTabBarController {
case .me:
guard let authenticationBox else { return }
let accountListViewModel = AccountListViewModel(authenticationBox: authenticationBox)
_ = self.sceneCoordinator?.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .formSheet)
_ = self.sceneCoordinator?.present(scene: .accountList(viewModel: accountListViewModel), from: self, transition: .formSheet(nil))
default:
break
}