Do not ask for password when exporting

pull/2/head
Michael Scoff 7 years ago
parent af6dae6570
commit a23832b76c
  1. 26
      Trust/Export/Coordinators/ExportCoordinator.swift

@ -56,20 +56,30 @@ class ExportCoordinator {
rootNavigationController.displayError(error: error)
}
}
func presentShareActivity(for account: Account, password: String) {
self.presentActivityViewController(for: account, password: password, completionHandler: {
self.finish()
})
}
}
extension ExportCoordinator: AccountsViewControllerDelegate {
func didSelectAccount(account: Account, in viewController: AccountsViewController) {
let verifyController = UIAlertController.askPassword(title: "Enter password to your wallet") { result in
switch result {
case .success(let password):
self.presentActivityViewController(for: account, password: password, completionHandler: {
self.finish()
})
case .failure: break
if let password = keystore.getPassword(for: account) {
self.presentShareActivity(for: account, password: password)
} else {
//TODO: Remove this part in future versions.
let verifyController = UIAlertController.askPassword(title: "Enter password to your wallet") { result in
switch result {
case .success(let password):
self.presentShareActivity(for: account, password: password)
case .failure: break
}
}
rootNavigationController.present(verifyController, animated: true, completion: nil)
}
rootNavigationController.present(verifyController, animated: true, completion: nil)
}
func didDeleteAccount(account: Account, in viewController: AccountsViewController) {

Loading…
Cancel
Save