When selling, don't show equivalent pricing in USD at all (was shown as 0) if ETH pricing is not available

pull/264/head
Hwee-Boon Yar 7 years ago
parent b644adc3c7
commit 6c4fb96963
  1. 2
      Trust/Sell/ViewControllers/EnterSellTicketsPriceQuantityViewController.swift
  2. 4
      Trust/Sell/ViewModels/EnterSellTicketsPriceQuantityViewControllerViewModel.swift

@ -275,6 +275,7 @@ class EnterSellTicketsPriceQuantityViewController: UIViewController {
dollarCostLabelLabel.textColor = viewModel.dollarCostLabelLabelColor dollarCostLabelLabel.textColor = viewModel.dollarCostLabelLabelColor
dollarCostLabelLabel.font = viewModel.dollarCostLabelLabelFont dollarCostLabelLabel.font = viewModel.dollarCostLabelLabelFont
dollarCostLabelLabel.text = R.string.localizable.aWalletTicketTokenSellDollarCostLabelTitle() dollarCostLabelLabel.text = R.string.localizable.aWalletTicketTokenSellDollarCostLabelTitle()
dollarCostLabelLabel.isHidden = viewModel.hideDollarCost
dollarCostLabel.textAlignment = .center dollarCostLabel.textAlignment = .center
dollarCostLabel.textColor = viewModel.dollarCostLabelColor dollarCostLabel.textColor = viewModel.dollarCostLabelColor
@ -282,6 +283,7 @@ class EnterSellTicketsPriceQuantityViewController: UIViewController {
dollarCostLabel.text = viewModel.dollarCostLabelText dollarCostLabel.text = viewModel.dollarCostLabelText
dollarCostLabel.backgroundColor = viewModel.dollarCostLabelBackgroundColor dollarCostLabel.backgroundColor = viewModel.dollarCostLabelBackgroundColor
dollarCostLabel.layer.masksToBounds = true dollarCostLabel.layer.masksToBounds = true
dollarCostLabel.isHidden = viewModel.hideDollarCost
quantityLabel.textAlignment = .center quantityLabel.textAlignment = .center
quantityLabel.textColor = viewModel.choiceLabelColor quantityLabel.textColor = viewModel.choiceLabelColor

@ -137,6 +137,10 @@ struct EnterSellTicketsPriceQuantityViewControllerViewModel {
return UIColor(red: 236, green: 236, blue: 236) return UIColor(red: 236, green: 236, blue: 236)
} }
var hideDollarCost: Bool {
return dollarCost.trimmed.isEmpty
}
init(ticketHolder: TicketHolder) { init(ticketHolder: TicketHolder) {
self.ticketHolder = ticketHolder self.ticketHolder = ticketHolder
} }

Loading…
Cancel
Save