Merge pull request #91 from ctk-hq/fix/network-reset

fix: network form reset
pull/92/head
Artem Golub 3 years ago committed by GitHub
commit 1249355d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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