Skip to content

Commit

Permalink
fix(wallet): the network form dirty state (#2847)
Browse files Browse the repository at this point in the history
  • Loading branch information
sstraatemans authored Jan 31, 2025
1 parent b5d9329 commit 7c71568
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,11 @@ export function NetworkForm({
onClose: () => void;
isOpen: boolean;
}) {
const {
control,
register,
handleSubmit,
getValues,
setValue,
watch,
formState,
reset,
} = useForm<INewNetwork>({
defaultValues: network,
mode: 'all',
});
const { control, register, handleSubmit, getValues, setValue, watch, reset } =
useForm<INewNetwork>({
defaultValues: network,
mode: 'all',
});
const { fields, append, remove } = useFieldArray({ control, name: 'hosts' });
const [error, setError] = useState<string>();
async function create(updNetwork: INewNetwork) {
Expand Down Expand Up @@ -279,10 +271,7 @@ export function NetworkForm({
<Button variant="outlined" onPress={() => onClose()} type="reset">
Cancel
</Button>
<Button
type="submit"
isDisabled={!isNetworkIdValid || !formState.isDirty}
>
<Button type="submit" isDisabled={!isNetworkIdValid}>
Save
</Button>
</RightAsideFooter>
Expand Down

0 comments on commit 7c71568

Please sign in to comment.