Skip to content

Commit

Permalink
gh-2672 Hide redeem deadline warning if allocation was redeemed
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatovital committed Sep 15, 2022
1 parent 2a0d57c commit 586a705
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
inputAmount = cell.value
claimButton.isEnabled = (error == nil) && claimButtonEnabled
}
cell.redeemDeadlineWarning = !data.isRedeemed
return cell

case .selectedDelegate:
Expand All @@ -384,6 +385,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource

var totalValue: String
var availableRange: Range<Sol.UInt128>

var isRedeemed: Bool
}

func displayValues(from claimData: ClaimingAppController.ClaimingData) -> DisplayValues {
Expand All @@ -409,6 +412,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
)
}

let isRedeemed = claimData.isRedeemed

// components and total of vested amount
let userVestedAmount: Sol.UInt128? = claimData.availableAmount(for: userAllocation, at: timestamp)
let ecoVestedAmount: Sol.UInt128? = claimData.availableAmount(for: ecosystemAllocation, at: timestamp)
Expand Down Expand Up @@ -486,7 +491,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
unvestedAmountTooltip: unvestedAmountTooltip,
unvestedStyle: lightBoxStyle,
totalValue: allocationText,
availableRange: availableRange
availableRange: availableRange,
isRedeemed: isRedeemed
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class ClaimedAmountInputCell: UITableViewCell {
fieldDelegate.isUsingMaxValue
}

var redeemDeadlineWarning: Bool {
get { !redeemWarningLabel.isHidden }
set { redeemWarningLabel.isHidden = !newValue }
}

override func awakeFromNib() {
super.awakeFromNib()
titleLabel.text = "How much do you want to claim?"
Expand Down

0 comments on commit 586a705

Please sign in to comment.