mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -249,12 +249,14 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleAppRoute(_ appRoute: AppRoute, windowType: SecondaryWindowType?) {
|
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 {
|
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)")
|
MXLog.info("Handling app route: \(appRoute)")
|
||||||
|
|
||||||
await resumeClientServices()
|
await resumeClientServices()
|
||||||
@@ -269,12 +271,12 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
|||||||
switch appRoute {
|
switch appRoute {
|
||||||
case .accountProvisioningLink:
|
case .accountProvisioningLink:
|
||||||
if let authenticationFlowCoordinator {
|
if let authenticationFlowCoordinator {
|
||||||
authenticationFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active)
|
authenticationFlowCoordinator.handleAppRoute(appRoute, animated: animated)
|
||||||
handled = true
|
handled = true
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if let userSessionFlowCoordinator {
|
if let userSessionFlowCoordinator {
|
||||||
userSessionFlowCoordinator.handleAppRoute(appRoute, animated: appMediator.appState == .active)
|
userSessionFlowCoordinator.handleAppRoute(appRoute, animated: animated)
|
||||||
handled = true
|
handled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user