Skip to content

Commit

Permalink
fix the issue where digital rewards could select physical add ons, re…
Browse files Browse the repository at this point in the history
…move duplicated add-ons call (#2010)
  • Loading branch information
mtgriego authored Apr 4, 2024
1 parent 9753b41 commit 765eb7f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AddOnsViewModel(val environment: Environment) : ViewModel() {
viewModelScope.launch {
emitCurrentState()
}
getAddOns(noShippingRule = false)
getAddOns(noShippingRule = shippingSelectorIsGone)
}.addToDisposable(disposables)

val shippingRule = getSelectedShippingRule(defaultShippingRuleObservable, currentUserReward)
Expand Down Expand Up @@ -191,8 +191,6 @@ class AddOnsViewModel(val environment: Environment) : ViewModel() {
emitCurrentState()
}

if (shippingSelectorIsGone) getAddOns(noShippingRule = true)

this.currentUserReward.onNext(reward)
}

Expand All @@ -205,7 +203,7 @@ class AddOnsViewModel(val environment: Environment) : ViewModel() {
emitCurrentState()
}

getAddOns(noShippingRule = false)
getAddOns(noShippingRule = shippingSelectorIsGone)
}

fun onAddOnsAddedOrRemoved(currentAddOnsSelections: MutableMap<Reward, Int>) {
Expand Down

0 comments on commit 765eb7f

Please sign in to comment.