Skip to content

Commit

Permalink
fix: reset create account dialog after success
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-chaturvedi committed Nov 5, 2024
1 parent 974e1f3 commit 642a002
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export const CreateServiceAccountDialog = () => {
const [thirdParty, setThirdParty] = useState(false)
const [createPending, setCreatePending] = useState(false)

const reset = () => {
setName('')
setThirdParty(false)
}

const roleOptions =
roleData?.roles.filter(
(option: RoleType) => option.name !== 'Owner' && option.name !== 'Admin'
Expand Down Expand Up @@ -123,6 +128,7 @@ export const CreateServiceAccountDialog = () => {
})

setCreatePending(false)
reset()

if (dialogRef.current) dialogRef.current.closeModal()

Expand Down

0 comments on commit 642a002

Please sign in to comment.