From d6271499484141c9b7ceb4a2694d18fe7383f244 Mon Sep 17 00:00:00 2001 From: Yishi Lin Date: Mon, 15 Jul 2019 01:37:20 +0800 Subject: [PATCH] Show encryption error while saving edition --- .../PasswordDetailTableViewController.swift | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pass/Controllers/PasswordDetailTableViewController.swift b/pass/Controllers/PasswordDetailTableViewController.swift index 592baba..5d8905f 100644 --- a/pass/Controllers/PasswordDetailTableViewController.swift +++ b/pass/Controllers/PasswordDetailTableViewController.swift @@ -196,13 +196,14 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni SVProgressHUD.show(withStatus: "Saving".localize()) do { self.passwordEntity = try self.passwordStore.edit(passwordEntity: self.passwordEntity!, password: self.password!) + self.setTableData() + self.tableView.reloadData() + SVProgressHUD.showSuccess(withStatus: "Success".localize()) + SVProgressHUD.dismiss(withDelay: 1) } catch { - Utils.alert(title: "Error".localize(), message: error.localizedDescription, controller: self, completion: nil) + SVProgressHUD.showSuccess(withStatus: error.localizedDescription) + SVProgressHUD.dismiss(withDelay: 1) } - self.setTableData() - self.tableView.reloadData() - SVProgressHUD.showSuccess(withStatus: "Success".localize()) - SVProgressHUD.dismiss(withDelay: 1) } } @@ -353,11 +354,12 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni if password!.changed != 0 { do { self.passwordEntity = try self.passwordStore.edit(passwordEntity: self.passwordEntity!, password: self.password!) + SVProgressHUD.showSuccess(withStatus: "PasswordCopied".localize() | "CounterUpdated".localize()) + SVProgressHUD.dismiss(withDelay: 1) } catch { - Utils.alert(title: "Error".localize(), message: error.localizedDescription, controller: self, completion: nil) + SVProgressHUD.showSuccess(withStatus: error.localizedDescription) + SVProgressHUD.dismiss(withDelay: 1) } - SVProgressHUD.showSuccess(withStatus: "PasswordCopied".localize() | "CounterUpdated".localize()) - SVProgressHUD.dismiss(withDelay: 1) } }