-
Notifications
You must be signed in to change notification settings - Fork 464
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: Display available spending limit amount #1346
Conversation
Branch preview✅ Deploy successful! https://fixspendinglimitamount--webcore.review-web-core.5afe.dev |
selectedToken: TokenInfo | undefined | ||
}) => { | ||
const { control } = useFormContext() | ||
|
||
const formattedAmount = formatVisualAmount(spendingLimit.amount, selectedToken?.decimals) | ||
const formattedAmount = safeFormatUnits(availableAmount, selectedToken?.decimals) |
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.
I decided to change this so that it doesn't cut off decimal places because it is the same as in safe-react.
spendingLimit: SpendingLimitState | ||
availableAmount: BigNumber |
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.
Simplified this so we don't have to compute amount-spent in two places.
ESLint Summary View Full Report
Report generated by eslint-plus-action |
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.
Works great!
One thing we should consider adding soon here is a cypress test for spending limits. we could setup a safe with a Spending limit and just check that the interface reacts accordingly.
What it solves
Resolves #1310
How this PR fixes it
How to test it
Screenshots