Skip to content

Commit

Permalink
Reset max selected field when switching asset
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarvu committed Jan 7, 2025
1 parent b30f98d commit 922dfd6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/app/src/features/dialogs/borrow/logic/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export function getFormFieldsForBorrowDialog({
const changeAsset = (newSymbol: TokenSymbol): void => {
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)
form.clearErrors()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function getFieldsForTransferFromUserForm({
const changeAsset = (newSymbol: TokenSymbol): void => {
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)
form.clearErrors()
}

Expand Down
1 change: 1 addition & 0 deletions packages/app/src/features/dialogs/deposit/logic/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function getFormFieldsForDepositDialog({
const changeAsset = (newSymbol: TokenSymbol): void => {
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)
form.clearErrors()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function getFormFieldsForWithdrawDialog({
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)

form.clearErrors()
}

Expand Down
1 change: 1 addition & 0 deletions packages/app/src/features/dialogs/withdraw/logic/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export function getFormFieldsForWithdrawDialog(
const changeAsset = (newSymbol: TokenSymbol): void => {
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)
form.clearErrors()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export function getFormFieldsForUnstakeDialog({
form.setValue('symbol', newSymbol)
form.setValue('value', '')
form.setValue('isMaxSelected', false)

form.clearErrors()
}

Expand Down

0 comments on commit 922dfd6

Please sign in to comment.