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

fix: set correct max amount from query params #1850

Merged
merged 7 commits into from
Aug 16, 2024
Merged

fix: set correct max amount from query params #1850

merged 7 commits into from
Aug 16, 2024

Conversation

brtkx
Copy link
Contributor

@brtkx brtkx commented Aug 15, 2024

Currently if query param amount=max, we always set the amount to max without accounting for gas. This happens because the initial maxAmount is undefined. Refactored it so that we wait for proper max estimation before setting the new amount.

@brtkx brtkx requested a review from fionnachan August 15, 2024 17:44
Copy link

vercel bot commented Aug 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Aug 16, 2024 10:42am

Comment on lines 92 to 94
if (maxAmount <= 0) {
return undefined
}
Copy link
Member

Choose a reason for hiding this comment

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

the input should still be set to the max amount available to show insufficient for gas error

otherwise clicking the max button would do nothing even though user has balance

@brtkx brtkx merged commit 92bc2b2 into master Aug 16, 2024
34 checks passed
@brtkx brtkx deleted the fix-max-amount branch August 16, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants