mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Display the notification mode for each room in the the room list (#1595)
Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
@@ -231,7 +231,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
break
|
||||
|
||||
case (.roomDetails, .presentNotificationSettingsScreen, .notificationSettingsScreen):
|
||||
asyncPresentNotificationSettingsScreen(animated: animated)
|
||||
presentNotificationSettingsScreen(animated: animated)
|
||||
case (.notificationSettingsScreen, .dismissNotificationSettingsScreen, .roomDetails):
|
||||
break
|
||||
|
||||
@@ -397,13 +397,13 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
return
|
||||
}
|
||||
|
||||
let params = await RoomDetailsScreenCoordinatorParameters(accountUserID: userSession.userID,
|
||||
navigationStackCoordinator: navigationStackCoordinator,
|
||||
roomProxy: roomProxy,
|
||||
mediaProvider: userSession.mediaProvider,
|
||||
userDiscoveryService: UserDiscoveryService(clientProxy: userSession.clientProxy),
|
||||
userIndicatorController: userIndicatorController,
|
||||
notificationSettings: userSession.clientProxy.notificationSettings())
|
||||
let params = RoomDetailsScreenCoordinatorParameters(accountUserID: userSession.userID,
|
||||
navigationStackCoordinator: navigationStackCoordinator,
|
||||
roomProxy: roomProxy,
|
||||
mediaProvider: userSession.mediaProvider,
|
||||
userDiscoveryService: UserDiscoveryService(clientProxy: userSession.clientProxy),
|
||||
userIndicatorController: userIndicatorController,
|
||||
notificationSettings: userSession.clientProxy.notificationSettings)
|
||||
let coordinator = RoomDetailsScreenCoordinator(parameters: params)
|
||||
coordinator.actions.sink { [weak self] action in
|
||||
switch action {
|
||||
@@ -691,19 +691,13 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
stateMachine.tryEvent(.presentRoom(roomID: roomID), userInfo: EventUserInfo(animated: true, destinationRoomProxy: targetRoomProxy))
|
||||
}
|
||||
|
||||
private func asyncPresentNotificationSettingsScreen(animated: Bool) {
|
||||
Task {
|
||||
await presentNotificationSettingsScreen(animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
private func presentNotificationSettingsScreen(animated: Bool) async {
|
||||
private func presentNotificationSettingsScreen(animated: Bool) {
|
||||
let navigationCoordinator = NavigationStackCoordinator()
|
||||
let parameters = await NotificationSettingsScreenCoordinatorParameters(navigationStackCoordinator: navigationCoordinator,
|
||||
userSession: userSession,
|
||||
userNotificationCenter: UNUserNotificationCenter.current(),
|
||||
notificationSettings: userSession.clientProxy.notificationSettings(),
|
||||
isModallyPresented: true)
|
||||
let parameters = NotificationSettingsScreenCoordinatorParameters(navigationStackCoordinator: navigationCoordinator,
|
||||
userSession: userSession,
|
||||
userNotificationCenter: UNUserNotificationCenter.current(),
|
||||
notificationSettings: userSession.clientProxy.notificationSettings,
|
||||
isModallyPresented: true)
|
||||
let coordinator = NotificationSettingsScreenCoordinator(parameters: parameters)
|
||||
coordinator.actions.sink { [weak self] action in
|
||||
switch action {
|
||||
|
||||
@@ -297,22 +297,16 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
// MARK: Settings
|
||||
|
||||
private func presentSettingsScreen(animated: Bool) {
|
||||
Task {
|
||||
await asyncPresentSettingsScreen(animated: animated)
|
||||
}
|
||||
}
|
||||
|
||||
private func asyncPresentSettingsScreen(animated: Bool) async {
|
||||
let settingsNavigationStackCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let userIndicatorController = UserIndicatorController(rootCoordinator: settingsNavigationStackCoordinator)
|
||||
|
||||
let parameters = await SettingsScreenCoordinatorParameters(navigationStackCoordinator: settingsNavigationStackCoordinator,
|
||||
userIndicatorController: userIndicatorController,
|
||||
userSession: userSession,
|
||||
bugReportService: bugReportService,
|
||||
notificationSettings: userSession.clientProxy.notificationSettings(),
|
||||
appSettings: appSettings)
|
||||
let parameters = SettingsScreenCoordinatorParameters(navigationStackCoordinator: settingsNavigationStackCoordinator,
|
||||
userIndicatorController: userIndicatorController,
|
||||
userSession: userSession,
|
||||
bugReportService: bugReportService,
|
||||
notificationSettings: userSession.clientProxy.notificationSettings,
|
||||
appSettings: appSettings)
|
||||
let settingsScreenCoordinator = SettingsScreenCoordinator(parameters: parameters)
|
||||
settingsScreenCoordinator.callback = { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
Reference in New Issue
Block a user