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

Commit

Permalink
Fix #2177: Sort custom tipping amounts from least to greatest BAT amo…
Browse files Browse the repository at this point in the history
…unt (#2179)
  • Loading branch information
kylehickinson authored Jan 13, 2020
1 parent 484c8df commit f16e820
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BraveRewardsUI/Tipping/TippingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ class TippingViewController: UIViewController, UIViewControllerTransitioningDele

self.tippingView.overviewView.disclaimerView.isHidden = banner.status == .verified

let bannerAmounts = banner.amounts.isEmpty ? TippingViewController.defaultTippingAmounts : banner.amounts.compactMap({ $0.doubleValue })
let bannerAmounts = banner.amounts.isEmpty ?
TippingViewController.defaultTippingAmounts :
banner.amounts.compactMap { $0.doubleValue }.sorted(by: <)
self.tippingView.optionSelectionView.options = bannerAmounts.map {
TippingOption.batAmount(BATValue($0), dollarValue: self.state.ledger.dollarStringForBATAmount($0) ?? "")
}
Expand Down

0 comments on commit f16e820

Please sign in to comment.