From cb8edbff4b2676e44576e30cdb5c3e3ca3ce0212 Mon Sep 17 00:00:00 2001 From: hcavarsan Date: Thu, 7 Dec 2023 20:03:19 -0300 Subject: [PATCH] fix: clean modal fields when open a new add config --- src/App.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 613b9507..ca5f34e6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -82,7 +82,17 @@ const App: React.FC = () => { remote_port: "", namespace: "", }) - const openModal = () => setIsModalOpen(true) + const openModal = () => { + setNewConfig({ + id: 0, + service: "", + context: "", + local_port: "", + remote_port: "", + namespace: "", + }); + setIsModalOpen(true); + } const closeModal = () => setIsModalOpen(false) const handleInputChange = (e: React.ChangeEvent) => { const { name, value } = e.target