diff --git a/Mastodon/Scene/Notification/Notification Filtering/Requests/Account Notifications/AccountNotificationTimelineViewController.swift b/Mastodon/Scene/Notification/Notification Filtering/Requests/Account Notifications/AccountNotificationTimelineViewController.swift index 70822f083..e53886a4a 100644 --- a/Mastodon/Scene/Notification/Notification Filtering/Requests/Account Notifications/AccountNotificationTimelineViewController.swift +++ b/Mastodon/Scene/Notification/Notification Filtering/Requests/Account Notifications/AccountNotificationTimelineViewController.swift @@ -33,6 +33,7 @@ class AccountNotificationTimelineViewController: NotificationTimelineViewControl guard let self else { return } coordinator.showLoading() + self.navigationController?.popViewController(animated: true) self.delegate?.acceptRequest(self, request: request) coordinator.hideLoading() }, @@ -40,6 +41,7 @@ class AccountNotificationTimelineViewController: NotificationTimelineViewControl guard let self else { return } coordinator.showLoading() + self.navigationController?.popViewController(animated: true) self.delegate?.dismissRequest(self, request: request) coordinator.hideLoading() } diff --git a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift index f25907070..60906a15a 100644 --- a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift +++ b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewController.swift @@ -126,6 +126,9 @@ extension NotificationTimelineViewController { @objc private func refreshControlValueChanged(_ sender: RefreshControl) { Task { + let policy = try? await context.apiService.notificationPolicy(authenticationBox: authContext.mastodonAuthenticationBox) + viewModel.notificationPolicy = policy?.value + await viewModel.loadLatest() } } diff --git a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift index a60f48025..707cc2173 100644 --- a/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift +++ b/Mastodon/Scene/Notification/NotificationTimeline/NotificationTimelineViewModel.swift @@ -21,7 +21,7 @@ final class NotificationTimelineViewModel { let context: AppContext let authContext: AuthContext let scope: Scope - let notificationPolicy: Mastodon.Entity.NotificationPolicy? + var notificationPolicy: Mastodon.Entity.NotificationPolicy? let dataController: FeedDataController @Published var isLoadingLatest = false @Published var lastAutomaticFetchTimestamp: Date? @@ -96,8 +96,10 @@ final class NotificationTimelineViewModel { //MARK: - Notifications @objc func notificationFilteringChanged(_ notification: Notification) { - dataController.records = [] Task { [weak self] in + let policy = try await context.apiService.notificationPolicy(authenticationBox: authContext.mastodonAuthenticationBox) + self?.notificationPolicy = policy.value + await self?.loadLatest() } }