This commit is contained in:
Bob Sun 2017-02-15 11:37:19 +08:00
parent a2fb5b4a2c
commit b2c5c2475b
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4

View file

@ -198,16 +198,18 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
var decryptedPassword: Password? var decryptedPassword: Password?
do { do {
decryptedPassword = try password.decrypt()! decryptedPassword = try password.decrypt()!
} catch {
print(error)
SVProgressHUD.showError(withStatus: error.localizedDescription)
SVProgressHUD.dismiss(withDelay: 1)
}
DispatchQueue.main.async { DispatchQueue.main.async {
UIPasteboard.general.string = decryptedPassword?.password UIPasteboard.general.string = decryptedPassword?.password
SVProgressHUD.showSuccess(withStatus: "Password Copied") SVProgressHUD.showSuccess(withStatus: "Password Copied")
SVProgressHUD.dismiss(withDelay: 0.6) SVProgressHUD.dismiss(withDelay: 0.6)
} }
} catch {
print(error)
DispatchQueue.main.async {
SVProgressHUD.showError(withStatus: error.localizedDescription)
SVProgressHUD.dismiss(withDelay: 1)
}
}
} }
} }