From bc8518ec3e728a2f3d44d829d4c8640c0f985568 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 27 Feb 2025 13:56:26 +0200 Subject: [PATCH] Increase the time before we show loading indicators when processing user session and flow coordinators routes --- ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift | 3 ++- .../FlowCoordinators/UserSessionFlowCoordinator.swift | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index d5c4eaee5..87b5f0367 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -230,8 +230,9 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { private func handleRoomRoute(roomID: String, via: [String], presentationAction: PresentationAction? = nil, animated: Bool) async { guard roomID == self.roomID else { fatalError("Navigation route doesn't belong to this room flow.") } - showLoadingIndicator(delay: .milliseconds(250)) + showLoadingIndicator(delay: .seconds(0.5)) defer { hideLoadingIndicator() } + guard let room = await userSession.clientProxy.roomForIdentifier(roomID) else { stateMachine.tryEvent(.presentJoinRoomScreen(via: via), userInfo: EventUserInfo(animated: animated)) return diff --git a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift index 73cdc3cf2..c2a93707b 100644 --- a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift @@ -146,10 +146,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { // MARK: - Private func asyncHandleAppRoute(_ appRoute: AppRoute, animated: Bool) async { - showLoadingIndicator(delay: .seconds(0.25)) - defer { - hideLoadingIndicator() - } + showLoadingIndicator(delay: .seconds(0.5)) + defer { hideLoadingIndicator() } await clearPresentedSheets(animated: animated)