diff --git a/Trust/Transfer/ViewControllers/SendViewController.swift b/Trust/Transfer/ViewControllers/SendViewController.swift index 6b69beebe..70c0cf2c5 100644 --- a/Trust/Transfer/ViewControllers/SendViewController.swift +++ b/Trust/Transfer/ViewControllers/SendViewController.swift @@ -105,7 +105,8 @@ class SendViewController: FormViewController { fiatButton.translatesAutoresizingMaskIntoConstraints = false fiatButton.setTitle(currentPair.right, for: .normal) fiatButton.addTarget(self, action: #selector(fiatAction), for: .touchUpInside) - + fiatButton.isHidden = isFiatViewHidden() + let amountRightView = UIStackView(arrangedSubviews: [ fiatButton, ]) @@ -116,7 +117,7 @@ class SendViewController: FormViewController { amountRightView.axis = .horizontal form = Section() - +++ Section(header: "", footer: "~ \(String(self.pairValue)) " + "\(currentPair.right)") + +++ Section(header: "", footer: isFiatViewHidden() ? "" : "~ \(String(self.pairValue)) " + "\(currentPair.right)") <<< AppFormAppearance.textFieldFloat(tag: Values.address) { $0.add(rule: EthereumAddressRule()) $0.validationOptions = .validatesOnDemand @@ -274,6 +275,13 @@ class SendViewController: FormViewController { } self.updatePriceSection() } + + private func isFiatViewHidden() -> Bool { + guard let rates = storage.tickers, let currentTokenInfo = rates[viewModel.symbol], let _ = Double(currentTokenInfo.price) else { + return true + } + return false + } } extension SendViewController: QRCodeReaderDelegate {