Dismiss room invite notifications when rejecting them from the home screen. (#4074)

This commit is contained in:
Doug
2025-04-28 16:33:49 +01:00
committed by GitHub
parent 8091d9c2a6
commit e14672e1f6
11 changed files with 89 additions and 70 deletions
@@ -16,6 +16,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
private let userSession: UserSessionProtocol
private let analyticsService: AnalyticsService
private let appSettings: AppSettings
private let notificationManager: NotificationManagerProtocol
private let userIndicatorController: UserIndicatorControllerProtocol
private let roomSummaryProvider: RoomSummaryProviderProtocol?
@@ -26,13 +27,15 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
}
init(userSession: UserSessionProtocol,
analyticsService: AnalyticsService,
appSettings: AppSettings,
selectedRoomPublisher: CurrentValuePublisher<String?, Never>,
appSettings: AppSettings,
analyticsService: AnalyticsService,
notificationManager: NotificationManagerProtocol,
userIndicatorController: UserIndicatorControllerProtocol) {
self.userSession = userSession
self.analyticsService = analyticsService
self.appSettings = appSettings
self.notificationManager = notificationManager
self.userIndicatorController = userIndicatorController
roomSummaryProvider = userSession.clientProxy.roomSummaryProvider
@@ -462,6 +465,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
switch result {
case .success:
await notificationManager.removeDeliveredMessageNotifications(for: roomID) // Normally handled by the room flow, but that's never presented in this case.
appSettings.seenInvites.remove(roomID)
case .failure:
displayError()