fix: notification not trigger update issue
This commit is contained in:
parent
6c6ab615c7
commit
11180ae62d
|
@ -30,7 +30,9 @@ extension NotificationSection {
|
|||
guard let dependency = dependency else { return nil }
|
||||
switch notificationItem {
|
||||
case .notification(let objectID, let attribute):
|
||||
let notification = managedObjectContext.object(with: objectID) as! MastodonNotification
|
||||
guard let notification = try? managedObjectContext.existingObject(with: objectID) as? MastodonNotification else {
|
||||
return UITableViewCell()
|
||||
}
|
||||
guard let type = Mastodon.Entity.Notification.NotificationType(rawValue: notification.typeRaw) else {
|
||||
// filter out invalid type using predicate
|
||||
assertionFailure()
|
||||
|
|
|
@ -143,10 +143,9 @@ extension NotificationViewController {
|
|||
|
||||
tableView.deselectRow(with: transitionCoordinator, animated: animated)
|
||||
|
||||
// fetch latest if has unread push notification
|
||||
if context.notificationService.hasUnreadPushNotification.value {
|
||||
// fetch latest notification when will appear
|
||||
viewModel.loadLatestStateMachine.enter(NotificationViewModel.LoadLatestState.Loading.self)
|
||||
}
|
||||
|
||||
|
||||
// needs trigger manually after onboarding dismiss
|
||||
setNeedsStatusBarAppearanceUpdate()
|
||||
|
|
Loading…
Reference in New Issue