diff --git a/Mastodon/Coordinator/SceneCoordinator.swift b/Mastodon/Coordinator/SceneCoordinator.swift index 0e9ff6f71..e80657a17 100644 --- a/Mastodon/Coordinator/SceneCoordinator.swift +++ b/Mastodon/Coordinator/SceneCoordinator.swift @@ -207,6 +207,7 @@ extension SceneCoordinator { case settings(setting: Setting) // Notifications + case notificationPolicy(viewModel: NotificationFilterViewModel) case notificationRequests(viewModel: NotificationRequestsViewModel) // report @@ -563,6 +564,8 @@ private extension SceneCoordinator { viewController = composeViewController case .notificationRequests(let viewModel): viewController = NotificationRequestsTableViewController(viewModel: viewModel) + case .notificationPolicy(let viewModel): + viewController = NotificationPolicyViewController(viewModel: viewModel) } setupDependency(for: viewController as? NeedsDependency) diff --git a/Mastodon/Scene/Notification/NotificationViewController.swift b/Mastodon/Scene/Notification/NotificationViewController.swift index 46fee81d0..cc18c80a1 100644 --- a/Mastodon/Scene/Notification/NotificationViewController.swift +++ b/Mastodon/Scene/Notification/NotificationViewController.swift @@ -127,16 +127,8 @@ extension NotificationViewController { newAccount: policy.filterNewAccounts, privateMentions: policy.filterPrivateMentions ) - //TODO: Move to SceneCoordinator, we'd need a new case for this - let notificationPolicyViewController = NotificationPolicyViewController(viewModel: policyViewModel) - notificationPolicyViewController.modalPresentationStyle = .formSheet - let navigationController = UINavigationController(rootViewController: notificationPolicyViewController) - if let sheet = navigationController.sheetPresentationController { - sheet.detents = [.medium(), .large()] - } - - present(navigationController, animated: true) + _ = coordinator.present(scene: .notificationPolicy(viewModel: policyViewModel), transition: .formSheet) } }