mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Show the unread notification count on the chats tab
Set the chats tab's badge count from the same value used for the app badge. The tab bar already renders it through the .badge modifier but that has no effect outside of a TabView or List, so the iPad tab rail now overlays a small NotificationCountBadge instead.
This commit is contained in:
@@ -447,7 +447,12 @@ struct TabRailView<Tag: Hashable>: View {
|
||||
}
|
||||
.buttonStyle(TabButtonStyle(isSelected: isSelected))
|
||||
.accessibilityAddTraits(isSelected ? .isSelected : [])
|
||||
.badge(10) // TODO: Check if this works.
|
||||
.overlay(alignment: .topTrailing) {
|
||||
if module.details.badgeCount > 0 {
|
||||
NotificationCountBadge(count: module.details.badgeCount, size: .small)
|
||||
.allowsHitTesting(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 8)
|
||||
|
||||
@@ -540,6 +540,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
let badgeCount = Int(userSession.clientProxy.totalUnreadNotifications)
|
||||
|
||||
chatsTabDetails.badgeCount = badgeCount
|
||||
|
||||
await flowParameters.notificationManager.removeDeliveredNotificationsForFullyReadRooms(roomSummaries)
|
||||
await flowParameters.notificationManager.updateAppBadgeCount(badgeCount)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user