Skip to content

Commit

Permalink
feat: i like safety
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Jan 24, 2024
1 parent 8384209 commit 0e384f5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ export const RecipientAddress = () => {
}, [])

const resetManualReceiveAddress = useCallback(() => {
// Reset the manual receive address in store
dispatch(tradeInput.actions.setManualReceiveAddress(undefined))
}, [dispatch])
// And also the form value itself, to avoid the user going from
// custom recipient -> cleared custom recipient -> custom recipient where the previously set custom recipient
// would be displayed, wrongly hinting this is the default wallet address
setFormValue(SendFormFields.Input, '')
}, [dispatch, setFormValue])

const onSubmit = useCallback(
(values: FieldValues) => {
Expand Down

0 comments on commit 0e384f5

Please sign in to comment.