Skip to content

Commit

Permalink
fixed issues with bonus amount being displayed incorrectly and being …
Browse files Browse the repository at this point in the history
…unable to be decremented
  • Loading branch information
mtgriego committed Apr 2, 2024
1 parent cc0b55f commit 0b1c376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ fun ItemizedRewardListContainer(

Row {
Text(
text = stringResource(id = R.string.Bonus_support),
text = stringResource(
id =
if (rewardsList.isNotEmpty()) R.string.Bonus_support
else R.string.Pledge_without_a_reward
),
style = typography.subheadlineMedium,
color = colors.textSecondary
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class ConfirmDetailsViewModel(val environment: Environment) : ViewModel() {
if (::projectData.isInitialized) {
pledgeReason = pledgeDataAndPledgeReason(projectData, reward).second
}
addedBonusSupport = 0.0

updateShippingAmount()

Expand Down Expand Up @@ -230,7 +231,7 @@ class ConfirmDetailsViewModel(val environment: Environment) : ViewModel() {
}

fun decrementBonusSupport() {
if (addedBonusSupport - minStepAmount >= initialBonusSupport) {
if ((addedBonusSupport + initialBonusSupport) - minStepAmount >= initialBonusSupport) {
addedBonusSupport -= minStepAmount
totalAmount = calculateTotal()
viewModelScope.launch {
Expand Down

0 comments on commit 0b1c376

Please sign in to comment.