Skip to content

Commit

Permalink
initialize the updateMembershipForm with the member's current details
Browse files Browse the repository at this point in the history
  • Loading branch information
eshark9312 committed Feb 13, 2024
1 parent c8787a6 commit fcce38b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ export const UpdateMembershipFormModal = ({ onClose, onSubmit, member }: Props)
mode: 'onChange',
})

useEffect(() => {
form.reset({
...updateMemberFormInitial,
rootAccount: accountOrNamed(allAccounts, member.rootAccount, 'Root Account'),
controllerAccount: accountOrNamed(allAccounts, member.controllerAccount, 'Controller Account'),
})
}, [updateMemberFormInitial, member, allAccounts])

const [controllerAccount, rootAccount, handle] = form.watch(['controllerAccount', 'rootAccount', 'handle'])

useEffect(() => {
Expand Down

0 comments on commit fcce38b

Please sign in to comment.