From 74128cac1ac4f1aaa85c2c519717ebf5db4f696f Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 2 Apr 2024 15:56:45 -0700 Subject: [PATCH] Revert "fixed issues with bonus amount being displayed incorrectly and being unable to be decremented" This reverts commit 0b1c376e910423b6462233efbad4692c7c60ce51. --- .../compose/projectpage/ConfirmPledgeDetailsScreen.kt | 6 +----- .../viewmodels/projectpage/ConfirmDetailsViewModel.kt | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/kickstarter/ui/activities/compose/projectpage/ConfirmPledgeDetailsScreen.kt b/app/src/main/java/com/kickstarter/ui/activities/compose/projectpage/ConfirmPledgeDetailsScreen.kt index ae799f4e50..bacc2c3a69 100644 --- a/app/src/main/java/com/kickstarter/ui/activities/compose/projectpage/ConfirmPledgeDetailsScreen.kt +++ b/app/src/main/java/com/kickstarter/ui/activities/compose/projectpage/ConfirmPledgeDetailsScreen.kt @@ -685,11 +685,7 @@ fun ItemizedRewardListContainer( Row { Text( - text = stringResource( - id = - if (rewardsList.isNotEmpty()) R.string.Bonus_support - else R.string.Pledge_without_a_reward - ), + text = stringResource(id = R.string.Bonus_support), style = typography.subheadlineMedium, color = colors.textSecondary ) diff --git a/app/src/main/java/com/kickstarter/viewmodels/projectpage/ConfirmDetailsViewModel.kt b/app/src/main/java/com/kickstarter/viewmodels/projectpage/ConfirmDetailsViewModel.kt index 364d1c76c8..1820ed56c4 100644 --- a/app/src/main/java/com/kickstarter/viewmodels/projectpage/ConfirmDetailsViewModel.kt +++ b/app/src/main/java/com/kickstarter/viewmodels/projectpage/ConfirmDetailsViewModel.kt @@ -99,7 +99,6 @@ class ConfirmDetailsViewModel(val environment: Environment) : ViewModel() { if (::projectData.isInitialized) { pledgeReason = pledgeDataAndPledgeReason(projectData, reward).second } - addedBonusSupport = 0.0 updateShippingAmount() @@ -231,7 +230,7 @@ class ConfirmDetailsViewModel(val environment: Environment) : ViewModel() { } fun decrementBonusSupport() { - if ((addedBonusSupport + initialBonusSupport) - minStepAmount >= initialBonusSupport) { + if (addedBonusSupport - minStepAmount >= initialBonusSupport) { addedBonusSupport -= minStepAmount totalAmount = calculateTotal() viewModelScope.launch {