Skip to content

Commit

Permalink
Show send button on iPad
Browse files Browse the repository at this point in the history
  • Loading branch information
SwenVanZanten committed Dec 29, 2019
1 parent 6cd1e4f commit 87e610c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions VergeiOS/Controllers/Send/SendViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class SendViewController: ThemeableViewController {
var applicationRepository: ApplicationRepository!
var walletClient: WalletClient!
var fiatRateTicker: FiatRateTicker!
var waitingForConfirmationPopover: Bool = false

weak var confirmButtonInterval: Timer?

Expand Down Expand Up @@ -197,6 +198,7 @@ class SendViewController: ThemeableViewController {
let enabled = self.txFactory.amount.doubleValue > 0.0
&& self.txFactory.amount.doubleValue <= self.walletAmount.doubleValue
&& self.txFactory.address != ""
&& self.waitingForConfirmationPopover == false

self.confirmButton.isEnabled = enabled
self.confirmButton.backgroundColor = (
Expand All @@ -216,12 +218,16 @@ class SendViewController: ThemeableViewController {
popoverController.sourceView = view
popoverController.sourceRect = CGRect(x: view.bounds.midX, y: view.bounds.midY, width: 0, height: 0)
popoverController.permittedArrowDirections = []
}

present(alertController, animated: true)
self.waitingForConfirmationPopover = true
} else {
self.present(alertController, animated: true)
}

getTxProposal { proposal in
self.txTransponder.create(proposal: proposal) { txp, errorResponse, _ in
self.waitingForConfirmationPopover = false

guard let txp = txp else {
return alertController.dismiss(animated: true) {
self.showTransactionError(errorResponse, txp: nil)
Expand All @@ -237,6 +243,10 @@ class SendViewController: ThemeableViewController {

alertController.addAction(sendAction)
alertController.addAction(UIAlertAction(title: "defaults.cancel".localized, style: .cancel))

if UIDevice.current.userInterfaceIdiom == .pad {
self.present(alertController, animated: true)
}
}
}
}
Expand Down

0 comments on commit 87e610c

Please sign in to comment.