diff --git a/src/app/components/dialog/EditMirrorDialog.tsx b/src/app/components/dialog/EditMirrorDialog.tsx index 2394320..c634954 100644 --- a/src/app/components/dialog/EditMirrorDialog.tsx +++ b/src/app/components/dialog/EditMirrorDialog.tsx @@ -2,7 +2,7 @@ import { Box, FormControl, Label, Link, Text, TextInput } from '@primer/react' import { Stack } from '@primer/react/lib-esm/Stack' import { Dialog } from '@primer/react/lib-esm/drafts' -import { useState } from 'react' +import { useEffect, useState } from 'react' interface EditMirrorDialogProps { orgLogin: string @@ -32,6 +32,10 @@ export const EditMirrorDialog = ({ // set to the current mirror name for display purposes const [newMirrorName, setNewMirrorName] = useState(mirrorName) + useEffect(() => { + setNewMirrorName(mirrorName) + }, [mirrorName, setNewMirrorName]) + if (!isOpen) { return null }