FIxes #2602 - Fix pushers not being registered on re-login after recent Onboarding changes

This commit is contained in:
Stefan Ceriu
2024-04-01 14:31:36 +03:00
committed by Stefan Ceriu
parent 27605da0bb
commit 2e6c5c036a
2 changed files with 13 additions and 1 deletions
@@ -23,7 +23,18 @@ final class NotificationManager: NSObject, NotificationManagerProtocol {
private let notificationCenter: UserNotificationCenterProtocol
private let appSettings: AppSettings
private var userSession: UserSessionProtocol?
private var userSession: UserSessionProtocol? {
didSet {
// If notification permissions were given previously then attempt re-registering
// for remote notifications on startup. Otherwise let the onboarding flow handle it
Task { @MainActor in
if await self.notificationCenter.authorizationStatus() == .authorized {
self.delegate?.registerForRemoteNotifications()
}
}
}
}
private var cancellables = Set<AnyCancellable>()
private var notificationsEnabled = false