Skip to content

Commit

Permalink
feat: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Jun 14, 2024
1 parent 6499fdb commit 2bf8078
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/components/DeFi/components/AssetInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,13 @@ export const AssetInput: React.FC<AssetInputProps> = ({
// onChange will send us the formatted value
// To get around this we need to get the value from the onChange using a ref
// Now when the max buttons are clicked the onChange will not fire
debugger
onChange(amountRef.current ?? '', isFiat)
}, [isFiat, onChange])

const handleValueChange = useCallback(
(values: NumberFormatValues) => {
// This fires anytime value changes including setting it on max click
// Store the value in a ref to send when we actually want the onChange to fire
debugger
amountRef.current = values.value
handleChange()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,9 @@ export const Deposit: React.FC<DepositProps> = ({
if (!contextDispatch) return

contextDispatch({ type: ThorchainSaversDepositActionType.SET_LOADING, payload: true })
return _validateCryptoAmount(value)
.then(x => {
debugger
return x
})
.finally(() => {
contextDispatch({ type: ThorchainSaversDepositActionType.SET_LOADING, payload: false })
})
return _validateCryptoAmount(value).finally(() => {
contextDispatch({ type: ThorchainSaversDepositActionType.SET_LOADING, payload: false })
})
},
[_validateCryptoAmount, contextDispatch],
)
Expand Down

0 comments on commit 2bf8078

Please sign in to comment.