fix: network form reset

pull/91/head
corpulent 3 years ago
parent 5b49a6031c
commit 7e8d1a4660

@ -65,7 +65,10 @@ const NetworkList: FunctionComponent<INetworkListProps> = (
const handleEdit = (networkUuid: string) => () => onEdit(networkUuid);
const handleRemove = (networkUuid: string) => () => onRemove(networkUuid);
const handleRemove = (e: any, networkUuid: string) => {
e.stopPropagation();
onRemove(networkUuid);
};
return (
<Root>
@ -83,7 +86,7 @@ const NetworkList: FunctionComponent<INetworkListProps> = (
variant="soft"
size="sm"
color="danger"
onClick={handleRemove(networkUuid)}
onClick={(e) => handleRemove(e, networkUuid)}
>
<MinusSmIcon className="h-4 w-4" />
</RemoveButton>

@ -62,8 +62,6 @@ const ModalNetwork = (props: IModalNetworkProps) => {
const handleRemove = useCallback(
(networkUuid: string) => {
onDeleteNetwork(networkUuid);
/* Show the new network form only when the selected node was deleted. */
/* BUG: If a selected node is deleted, it still remains in the form. */
if (selectedNetwork?.key === networkUuid) {
setSelectedNetwork(null);
}

Loading…
Cancel
Save