Skip to content

Commit

Permalink
Avoid showing error messages for transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Scoff committed Jan 9, 2018
1 parent af0aabe commit 8947bd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Trust/Accounts/Coordinators/AccountsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class AccountsCoordinator: Coordinator {
let controller = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
controller.popoverPresentationController?.sourceView = sender
controller.popoverPresentationController?.sourceRect = sender.centerRect
let actionTitle = NSLocalizedString("wallets.backup.alertSheet.title", value: "Backup Keystore", comment: "The title of the backup button in the wallet's action sheet")

switch account.type {
case .real(let account):
let actionTitle = NSLocalizedString("wallets.backup.alertSheet.title", value: "Backup Keystore", comment: "The title of the backup button in the wallet's action sheet")
let backupKeystoreAction = UIAlertAction(title: actionTitle, style: .default) { _ in
let coordinator = BackupCoordinator(
navigationController: self.navigationController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ class TransactionDataCoordinator {
}

func handleError(error: Error) {
delegate?.didUpdate(result: .failure(TransactionError.failedToFetch))
//delegate?.didUpdate(result: .failure(TransactionError.failedToFetch))
// Avoid showing an error on failed request, instead show cached transactions.
handleUpdateItems()
}

func handleUpdateItems() {
delegate?.didUpdate(result: .success(self.storage.objects))
delegate?.didUpdate(result: .success(storage.objects))
}

func stop() {
Expand Down

0 comments on commit 8947bd5

Please sign in to comment.