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

feature: Swap/change logic when user is picking the same asset #2898

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

SorinC6
Copy link
Contributor

@SorinC6 SorinC6 commented Nov 10, 2023

if (id === orderData.amounts.sell.tokenId && isSellTouched) {
resetQuantities()
switchTokens()
}
if (shouldUpdateToken) {
buyTokenInfoChanged({
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it necessary to call buyTokenInfoChanged after we call switchTokens?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, do we need to resetQuantities? I thought it was just switch them

Copy link
Member

Choose a reason for hiding this comment

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

Yap, otomh switchtokens instead of setting will do the job, can we make a variable more descriptive? Smth like shouldSwithTokens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jorbuedo as described in the design when the user is picking the same assets the inputs will be reset

@stackchain stackchain changed the title SWAP/change logic when user is picking the same asset feature: Swap/change logic when user is picking the same asset Nov 11, 2023
@stackchain stackchain added this to the 4.23.0 milestone Nov 11, 2023
@stackchain stackchain merged commit b6004ef into develop Nov 13, 2023
@stackchain stackchain deleted the swap/same-asset-selection branch November 13, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants