-
-
Notifications
You must be signed in to change notification settings - Fork 278
fix: quote request should not be sent of amount of token requested by the user is 0 #8554
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
base: main
Are you sure you want to change the base?
Changes from all commits
5bfa16c
1d0bce3
7f9ce88
a969dd0
f6a4071
7a28240
dae645e
db25703
868b17d
68f6ac3
f83bf0f
bd9f3a0
1b7f538
45a11d7
7c350b3
7e3d54f
0b893bb
ef7089e
d6d0050
350ff2c
2a0467b
ac28b25
9a55495
14693e5
193cc90
722493b
fe7577d
f526d8c
d2a8ad4
d770b87
2383954
07c7f81
1122a77
58390c2
7dc9631
612e71d
cc70919
9db2698
6efd589
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,8 +65,6 @@ export async function updateQuotes( | |
| return false; | ||
| } | ||
|
|
||
| log('Updating quotes', { transactionId }); | ||
|
|
||
| const { | ||
| accountOverride, | ||
| isMaxAmount, | ||
|
|
@@ -78,6 +76,18 @@ export async function updateQuotes( | |
| tokens, | ||
| } = transactionData; | ||
|
|
||
| const hasNonZeroTokenAmount = | ||
| !tokens?.length || | ||
| isMaxAmount === true || | ||
| tokens.some((token) => !token.skipIfBalance && token.amountRaw !== '0'); | ||
|
|
||
| if (!hasNonZeroTokenAmount) { | ||
| log('Skipping quotes, all token amounts are zero', { transactionId }); | ||
| return false; | ||
| } | ||
|
|
||
| log('Updating quotes', { transactionId }); | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On money account page token / accountOverride can be updated few times. We need to ensure that quotes is not refetched unless user enters a non-zero token amount. Thus this change is made. Another approach could be to change methods |
||
| const from = accountOverride ?? (transaction.txParams.from as Hex); | ||
|
|
||
| updateTransactionData(transactionId, (data) => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.