Update policy after changes
This commit is contained in:
parent
8d535be84a
commit
766e631217
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue