-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add isWaitingToUpdateInputValue + animation to AssetChainInput, Add priceChangePercentage #242
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
export const isInvertingSwapAtom = atom(false); | ||
|
||
export const invertSwapAtom = atom(null, (get, set, swapDirection: SwapDirection) => { | ||
const sourceAsset = get(sourceAssetAtom); | ||
const destinationAsset = get(destinationAssetAtom); | ||
set(isInvertingSwapAtom, true); | ||
|
||
set(swapDirectionAtom, swapDirection); | ||
|
||
set(sourceAssetAtom, destinationAsset); | ||
if (destinationAsset?.amount) { | ||
set(sourceAssetAmountAtom, destinationAsset?.amount); | ||
} | ||
|
||
set(destinationAssetAtom, sourceAsset); | ||
if (sourceAsset?.amount) { | ||
set(destinationAssetAmountAtom, sourceAsset?.amount); | ||
} | ||
|
||
set(isInvertingSwapAtom, false); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isInvertingSwapAtom
helps to reduce the amount of route requests made when swapping between source and destination assets to 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it still need to fetch the route
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codingki yeah it still needs to fetch the route but before we were fetching extra times
Widget.-.Widget.Storybook.-.16.September.2024.mp4