Jump straight to notification tap and external deep link targets

Whether to animate a route was decided after resuming the client
services, by which time a notification tap or an external deep link
had already made the app active, so the user watched a navigation
animation from the room list. Read the app state as soon as the route
arrives instead, so these land directly on their target while routes
handled in the foreground keep animating.
This commit is contained in:
Stefan Ceriu
2026-09-30 12:52:39 +03:00
parent a87d65b05a
commit b21d27dbbc
@@ -249,12 +249,14 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
}
func handleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?) {
// Read before resuming the services, by which time a push tap or deep link will have made the app active.
let animated = appMediator.appState == .active
Task {
await asyncHandleAppRoute(appRoute, windowType: windowType)
await asyncHandleAppRoute(appRoute, windowType: windowType, animated: animated)
}
}
private func asyncHandleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?) async {
private func asyncHandleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?, animated: Bool) async {
MXLog.info("Handling app route: \(appRoute)")
await resumeClientServices()
@@ -269,12 +271,12 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
switch appRoute {
case .accountProvisioningLink:
if let authenticationFlowCoordinator {
authenticationFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active)
authenticationFlowCoordinator.handleAppRoute(appRoute, animated: animated)
handled = true
}
default:
if let userSessionFlowCoordinator {
userSessionFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active)
userSessionFlowCoordinator.handleAppRoute(appRoute, animated: animated)
handled = true
}
}