Skip to content

Commit

Permalink
fix: reset with empty string on deletion of twilio credentials. (#4958)
Browse files Browse the repository at this point in the history
  • Loading branch information
justynoh authored Sep 28, 2022
1 parent 6f256c5 commit 0e9f2bc
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ export const TwilioDetailsInputs = (): JSX.Element => {
[hasExistingTwilioCreds, register],
)

const onDelete = useCallback(
() =>
reset({
accountSid: '',
apiKey: '',
apiSecret: '',
messagingServiceSid: '',
}),
[reset],
)

return (
<>
<Stack spacing="2rem">
Expand Down Expand Up @@ -192,7 +203,11 @@ export const TwilioDetailsInputs = (): JSX.Element => {
</Button>
)}
</Skeleton>
<DeleteTwilioModal isOpen={isOpen} onClose={onClose} onDelete={reset} />
<DeleteTwilioModal
isOpen={isOpen}
onClose={onClose}
onDelete={onDelete}
/>
</>
)
}

0 comments on commit 0e9f2bc

Please sign in to comment.