feat: implement Live Activity registration service and enhance notifications handling
This commit is contained in:
@@ -83,6 +83,7 @@ final class AuthViewModel {
|
||||
// Clear anyway
|
||||
keychain.clearTokens()
|
||||
}
|
||||
LiveActivityRegistrationService.shared.stop()
|
||||
isAuthenticated = false
|
||||
currentUser = nil
|
||||
}
|
||||
@@ -92,5 +93,6 @@ final class AuthViewModel {
|
||||
if granted {
|
||||
PushNotificationService.shared.registerForRemoteNotifications()
|
||||
}
|
||||
LiveActivityRegistrationService.shared.start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ final class NotificationsViewModel {
|
||||
let page = try await service.getNotifications(limit: limit, offset: 0)
|
||||
notifications = page.notifications
|
||||
unreadCount = page.unreadCount
|
||||
hasMore = notifications.count < page.total
|
||||
hasMore = page.hasMore
|
||||
updateBadge()
|
||||
} catch {
|
||||
self.error = error.localizedDescription
|
||||
@@ -55,7 +55,7 @@ final class NotificationsViewModel {
|
||||
notifications.append(contentsOf: page.notifications)
|
||||
unreadCount = page.unreadCount
|
||||
currentOffset = nextOffset
|
||||
hasMore = notifications.count < page.total
|
||||
hasMore = page.hasMore
|
||||
} catch {
|
||||
self.error = error.localizedDescription
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user