From b2c5c2475b1a95e279015a079b42a7505b09c866 Mon Sep 17 00:00:00 2001 From: Bob Sun Date: Wed, 15 Feb 2017 11:37:19 +0800 Subject: [PATCH] fix bugs --- pass/Controllers/PasswordsViewController.swift | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 48b6bff..d51b385 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -198,15 +198,17 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV var decryptedPassword: Password? do { decryptedPassword = try password.decrypt()! + DispatchQueue.main.async { + UIPasteboard.general.string = decryptedPassword?.password + SVProgressHUD.showSuccess(withStatus: "Password Copied") + SVProgressHUD.dismiss(withDelay: 0.6) + } } catch { print(error) - SVProgressHUD.showError(withStatus: error.localizedDescription) - SVProgressHUD.dismiss(withDelay: 1) - } - DispatchQueue.main.async { - UIPasteboard.general.string = decryptedPassword?.password - SVProgressHUD.showSuccess(withStatus: "Password Copied") - SVProgressHUD.dismiss(withDelay: 0.6) + DispatchQueue.main.async { + SVProgressHUD.showError(withStatus: error.localizedDescription) + SVProgressHUD.dismiss(withDelay: 1) + } } } }