Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DON-596 - fix logic when a tip is pending #1367

Merged
merged 3 commits into from
Oct 30, 2023
Merged

Conversation

NoelLH
Copy link
Contributor

@NoelLH NoelLH commented Oct 30, 2023

  • set tip numbers to 0 explicitly as an existing tip's detected
  • add an extra check to prevent creating another tip if form data somehow gets out of sync

* set tip numbers to 0 explicitly as an existing tip's detected
* add an extra check to prevent creating another tip if form data
somehow gets out of sync
@NoelLH NoelLH self-assigned this Oct 30, 2023
@@ -23,8 +23,8 @@ <h3 class="b-rh-1 b-bold">Transfer Donation Funds</h3>
Must be between {{ minimumCreditAmount | exactCurrency:currency }} and {{ maximumCreditAmount | exactCurrency:currency }} inclusive.
</p>

<div *ngIf="(donor.pending_tip_balance?.gbp || 0) > 0">
<p>Thanks for tipping Big Give {{ ((donor.pending_tip_balance?.gbp || 0) / 100) | exactCurrency:"GBP" }} </p>
<div *ngIf="pendingTipBalance > 0">
Copy link
Contributor

@bdsl bdsl Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this expression pendingTipBalance > 0 is used three times - probably worth making it into a function like donorHasPendingTip: () => boolean or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 5e0cb12

Copy link
Contributor

@bdsl bdsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure where the bug was in the old code, but new version looks good so no harm in merging and re-testing.

@NoelLH NoelLH merged commit f06a171 into develop Oct 30, 2023
@NoelLH NoelLH deleted the DON-596-fix-silent-tips branch October 30, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants