From 69c3d218b9280a625388724e506ac321d630da16 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 4 Nov 2019 21:10:02 -0600 Subject: [PATCH] Automatically dismiss account inspector on account deletion when presented as a modal dialog. --- iOS/Inspector/AccountInspectorViewController.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/iOS/Inspector/AccountInspectorViewController.swift b/iOS/Inspector/AccountInspectorViewController.swift index fb0f153dc..ca6087fcf 100644 --- a/iOS/Inspector/AccountInspectorViewController.swift +++ b/iOS/Inspector/AccountInspectorViewController.swift @@ -74,9 +74,13 @@ class AccountInspectorViewController: UITableViewController { let markTitle = NSLocalizedString("Delete", comment: "Delete") let markAction = UIAlertAction(title: markTitle, style: .default) { [weak self] (action) in - guard let account = self?.account else { return } + guard let self = self, let account = self.account else { return } AccountManager.shared.deleteAccount(account) - self?.navigationController?.popViewController(animated: true) + if self.isModal { + self.dismiss(animated: true) + } else { + self.navigationController?.popViewController(animated: true) + } } alertController.addAction(markAction)