Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #1689: Display the correct BAT value for one-time-tips
Browse files Browse the repository at this point in the history
Also fixes the duplication of "USD" in the tips list
  • Loading branch information
kylehickinson committed Oct 16, 2019
1 parent a041645 commit 516252c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,19 @@ extension TipsDetailViewController: UITableViewDataSource, UITableViewDelegate {
cell.siteImageView.image = UIImage(frameworkResourceNamed: "defaultFavicon")
setFavicon(identifier: tip.id, pageURL: tip.url, faviconURL: tip.faviconUrl)
cell.verifiedStatusImageView.isHidden = tip.status != .verified
let contribution = tip.weight
switch tip.rewardsCategory {
case .oneTimeTip:
cell.typeNameLabel.text = Strings.OneTimeText + Date.stringFrom(reconcileStamp: tip.reconcileStamp)
cell.tokenView.batContainer.amountLabel.text = BATValue(probi: "\(contribution)")?.displayString
case .recurringTip:
cell.tokenView.batContainer.amountLabel.text = BATValue(contribution).displayString
cell.typeNameLabel.text = Strings.RecurringText
default:
cell.tokenView.batContainer.amountLabel.text = ""
cell.typeNameLabel.text = ""
}
let contribution = tip.weight
cell.tokenView.batContainer.amountLabel.text = "\(contribution)"
cell.tokenView.usdContainer.amountLabel.text = state.ledger.dollarStringForBATAmount(contribution)
cell.tokenView.usdContainer.amountLabel.text = state.ledger.dollarStringForBATAmount(contribution, includeCurrencyCode: false)
return cell
}
}
Expand Down

0 comments on commit 516252c

Please sign in to comment.