diff --git a/pass/Controllers/AdvancedSettingsTableViewController.swift b/pass/Controllers/AdvancedSettingsTableViewController.swift index 2baf952..a03f529 100644 --- a/pass/Controllers/AdvancedSettingsTableViewController.swift +++ b/pass/Controllers/AdvancedSettingsTableViewController.swift @@ -60,27 +60,23 @@ class AdvancedSettingsTableViewController: UITableViewController { } else if tableView.cellForRow(at: indexPath) == discardChangesTableViewCell { let alert = UIAlertController(title: "Discard All Changes?", message: "Do you want to permanently discard all changes to the local copy of your password data? You cannot undo this action.", preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "Discard All Changes", style: UIAlertActionStyle.destructive, handler: {[unowned self] (action) -> Void in - DispatchQueue.global(qos: .userInitiated).async { - SVProgressHUD.show(withStatus: "Resetting ...") - DispatchQueue.main.async { - do { - let numberDiscarded = try self.passwordStore.reset() - self.navigationController!.popViewController(animated: true) - switch numberDiscarded { - case 0: - SVProgressHUD.showSuccess(withStatus: "No local commits") - case 1: - SVProgressHUD.showSuccess(withStatus: "Discarded 1 commit") - default: - SVProgressHUD.showSuccess(withStatus: "Discarded \(numberDiscarded) commits") - } - SVProgressHUD.dismiss(withDelay: 1) - } catch { - Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil) - } + SVProgressHUD.show(withStatus: "Resetting ...") + do { + let numberDiscarded = try self.passwordStore.reset() + self.navigationController!.popViewController(animated: true) + switch numberDiscarded { + case 0: + SVProgressHUD.showSuccess(withStatus: "No local commits") + case 1: + SVProgressHUD.showSuccess(withStatus: "Discarded 1 commit") + default: + SVProgressHUD.showSuccess(withStatus: "Discarded \(numberDiscarded) commits") } + SVProgressHUD.dismiss(withDelay: 1) + } catch { + Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil) } - + })) alert.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.cancel, handler:nil)) self.present(alert, animated: true, completion: nil)