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: bugs in amount field, disable unlock button without any tokens #95

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

schmanu
Copy link
Member

@schmanu schmanu commented Apr 3, 2024

What this PR fixes

  • Always uses backend data for token amounts
  • validates zero and negative amounts
  • disabled unlock navigation without any amounts
  • disabled max button without balance

Copy link

github-actions bot commented Apr 3, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Apr 3, 2024

Branch preview

✅ Deploy successful!

https://fix_non_positive_amounts--governance.review-react-br.5afe.dev

@schmanu schmanu requested a review from katspaugh April 3, 2024 21:51
@@ -56,6 +56,9 @@ export const UnlockTokenWidget = ({
if (parsed.gt(currentlyLocked ?? '0')) {
return 'Amount exceeds locked tokens'
}
if (parsed.lte(0)) {
return 'Amount needs to be greater zero'
Copy link
Member

@katspaugh katspaugh Apr 4, 2024

Choose a reason for hiding this comment

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

Suggested change
return 'Amount needs to be greater zero'
return 'Amount must be greater than zero'

@@ -78,6 +78,9 @@ export const LockTokenWidget = ({ safeBalance }: { safeBalance: BigNumberish | u
if (parsed.gt(safeBalance ?? '0')) {
return 'Amount exceeds balance'
}
if (parsed.lte(0)) {
return 'Amount needs to be greater zero'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return 'Amount needs to be greater zero'
return 'Amount must be greater than zero'

@schmanu schmanu requested a review from katspaugh April 4, 2024 13:28
@schmanu schmanu merged commit d39e7ff into token-locking Apr 4, 2024
5 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants