Skip to content

Conversation

nutrina
Copy link
Contributor

@nutrina nutrina commented Dec 10, 2021

Description

Ensure that the same token is used in calculations for the items in the checkout cart for ETH network

Refers/Fixes

GITC-665

Testing

GIVEN I have one ore more items in my cart with 0 matching and another token except DAI selected for checkout
WHEN I add another grant to the cart in the Grants Explorer
THEN I expect to see a single token in the summary (namely the one chosen in the cart)

@nutrina nutrina force-pushed the GITC-665-mismatch-grants-token-and-cart branch from 84e808b to 3e62f90 Compare December 10, 2021 09:03

if (!this.selectedETHCartToken) {
this.selectedETHCartToken = 'DAI';
}
Copy link
Contributor

@thelostone-mc thelostone-mc Dec 10, 2021

Choose a reason for hiding this comment

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

Thoughts on rewriting this as :

this.selectedETHCartToken = 
(grantData.length > 0) && grantData[0].grant_donation_currency ? 
grantData[0].grant_donation_currency :  'DAI'

we can remove the loop itself and there shouldn't be any grantData without grant_donation_currency so maybe the grantData[0].grant_donation_currency check is not required as well

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 :)

@thelostone-mc thelostone-mc changed the base branch from stable to master December 10, 2021 11:39
@nutrina nutrina force-pushed the GITC-665-mismatch-grants-token-and-cart branch from 3e62f90 to 81fe567 Compare December 10, 2021 14:15
@nutrina nutrina force-pushed the GITC-665-mismatch-grants-token-and-cart branch from 81fe567 to c1de8cc Compare December 10, 2021 14:17
@thelostone-mc thelostone-mc merged commit 30a2867 into master Dec 14, 2021
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