Skip to content

Commit

Permalink
fix: re-enable move funds button after transfer (#1875)
Browse files Browse the repository at this point in the history
  • Loading branch information
fionnachan authored Sep 9, 2024
1 parent bf1f26f commit 6a67736
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ export const TransferPanelMainInput = React.memo(
const [localValue, setLocalValue] = useState(value)

useEffect(() => {
/**
* If value is empty, set localValue to empty string
* this is useful when transfer was successful and the `amount` query param
* was reset to an empty string
*/
if (value === '') {
setLocalValue('')
}

if (!isMaxAmount || !maxAmount) {
return
}
Expand All @@ -233,7 +242,7 @@ export const TransferPanelMainInput = React.memo(
* If user types anything before we receive the amount, isMaxAmount is set to false in the parent
*/
setLocalValue(maxAmount)
}, [isMaxAmount, maxAmount])
}, [isMaxAmount, maxAmount, value])

const handleMaxButtonClick: React.MouseEventHandler<HTMLButtonElement> =
useCallback(
Expand Down

0 comments on commit 6a67736

Please sign in to comment.