preview: mirror fork PR #7711#7712
Draft
github-actions[bot] wants to merge 3 commits into
Draft
Conversation
When the destination token is changed in swap-and-bridge mode, the price impact briefly rendered a huge/scary value derived from the previous quote while the new bridge quote was still being fetched. `PriceImpactIndicator` already received the `loading` flag but rendered the (stale) percentage *and* the spinner side by side. Gate the percentage on `!priceImpactLoading` so only the spinner shows while a fresh quote is being computed, matching the rest of the bridge-quote loading UX. Closes #7429
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Deploying explorer-dev with
|
| Latest commit: |
d790ffd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://34b9ad7e.explorer-dev-dxz.pages.dev |
| Branch Preview URL: | https://cf-preview-pr-7711.explorer-dev-dxz.pages.dev |
Deploying swap-dev with
|
| Latest commit: |
d790ffd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3dd7895f.swap-dev-5u6.pages.dev |
| Branch Preview URL: | https://cf-preview-pr-7711.swap-dev-5u6.pages.dev |
The previous fix only stopped \`PriceImpactIndicator\` from rendering a
stale percentage during USD-loading. The reporter still saw a scary
value on same-chain quote refreshes: when the destination token
changes, the trade form keeps the previous \`outputCurrencyAmount\` until
the new quote lands, and during that window \`useFiatValuePriceImpact\`
happily divides the new input USD by the old output USD, producing a
huge nonsense %.
Pull \`isLoading\` / \`hasParamsChanged\` out of \`useTradeQuote()\` and
fold them into the price-impact loading flag. While that combined flag
is true, return \`{ priceImpact: undefined, isLoading: true }\` so every
consumer falls back to the loading state (spinner) instead of rendering
the stale value.
Closes #7429
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR mirrors fork PR #7711 for Cloudflare Pages preview builds.
Source PR: #7711
Source fork branch:
tenderdeve/cowswap:fix/7429-bridge-quote-loading-price-impactMirrored SHA:
d790ffde4649Do not merge this PR. Close the source PR to clean up this mirror.