FF to enable/disable focussing the event on notification tap

This commit is contained in:
Mauro Romito
2025-11-04 13:45:48 +01:00
committed by Mauro
parent 8ef079a768
commit 74f51367e6
4 changed files with 11 additions and 2 deletions
@@ -347,6 +347,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
return
}
let eventID = appSettings.focusEventOnNotificationTap ? content.eventID : nil
if content.categoryIdentifier == NotificationConstants.Category.invite {
if let userSession {
userSession.clientProxy.roomsToAwait.insert(roomID)
@@ -355,8 +356,8 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
}
handleAppRoute(.room(roomID: roomID, via: []))
} else if appSettings.threadsEnabled, let threadRootEventID = content.threadRootEventID {
handleAppRoute(.thread(roomID: roomID, threadRootEventID: threadRootEventID, focusEventID: content.eventID))
} else if let eventID = content.eventID {
handleAppRoute(.thread(roomID: roomID, threadRootEventID: threadRootEventID, focusEventID: eventID))
} else if let eventID {
handleAppRoute(.event(eventID: eventID, roomID: roomID, via: []))
} else {
handleAppRoute(.room(roomID: roomID, via: []))
@@ -66,6 +66,7 @@ final class AppSettings {
case linkPreviewsEnabled
case latestEventSorterEnabled
case spaceSettingsEnabled
case focusEventOnNotificationTap
// Doug's tweaks 🔧
case hideUnreadMessagesBadge
@@ -390,6 +391,9 @@ final class AppSettings {
@UserPreference(key: UserDefaultsKeys.threadsEnabled, defaultValue: false, storageType: .userDefaults(store))
var threadsEnabled
@UserPreference(key: UserDefaultsKeys.focusEventOnNotificationTap, defaultValue: false, storageType: .userDefaults(store))
var focusEventOnNotificationTap
@UserPreference(key: UserDefaultsKeys.spaceSettingsEnabled, defaultValue: false, storageType: .userDefaults(store))
var spaceSettingsEnabled