From 60bb495b2dbd3ecd2b74ff239c1b866692f45696 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 23 Nov 2023 18:24:37 +0100 Subject: [PATCH] Fixing a crash that happened when leaving the room through the details screen (#2160) --- ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift | 5 ++--- changelog.d/pr-2160.bugfix | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 changelog.d/pr-2160.bugfix diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 0057b577b..e8730868e 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -410,10 +410,9 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { } private func dismissRoom(animated: Bool) { - // Setting the detail coordinator to nil afirst allows the dismiss to work properly - // if followed immediately by another navigation on iPhone - navigationSplitCoordinator.setDetailCoordinator(nil, animated: animated) + // DON'T CHANGE THE ORDER IN WHICH POP AND SET ARE DONE, IT CAN CAUSE A CRASH navigationStackCoordinator.popToRoot(animated: false) + navigationSplitCoordinator.setDetailCoordinator(nil, animated: animated) roomProxy = nil timelineController = nil diff --git a/changelog.d/pr-2160.bugfix b/changelog.d/pr-2160.bugfix new file mode 100644 index 000000000..6dbba6118 --- /dev/null +++ b/changelog.d/pr-2160.bugfix @@ -0,0 +1 @@ +Fixed a crash that happened when leaving a room through the details screen. \ No newline at end of file