From 8da89986df4cfcb896b0a9ce9317e06e969a41d8 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 31 Oct 2022 17:39:57 -0400 Subject: [PATCH] Fix find instance VC requiring double dismiss --- Tusker/Screens/FindInstanceViewController.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/FindInstanceViewController.swift b/Tusker/Screens/FindInstanceViewController.swift index 9526dd89..f49a2c45 100644 --- a/Tusker/Screens/FindInstanceViewController.swift +++ b/Tusker/Screens/FindInstanceViewController.swift @@ -37,7 +37,14 @@ class FindInstanceViewController: InstanceSelectorTableViewController { // MARK: - Interaction @objc func cancelButtonPressed() { - dismiss(animated: true) + // when the search controller is active, dismiss exits it rather than dismissing ourself, so we have to dismiss twice + if searchController.isActive { + dismiss(animated: false) { + self.dismiss(animated: true) + } + } else { + dismiss(animated: true) + } } }