diff --git a/src/App.tsx b/src/App.tsx index 7557da80..3fc930d2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,10 +13,13 @@ interface Response { function App() { const [responseBody, setResponseBody] = useState(null); const [url, setUrl] = useState(""); + const [loading, setLoading] = useState(false); async function sendRequest() { + setLoading(true); const body = await invoke("send_request", {url: url}) as Response; setResponseBody(body); + setLoading(false); } return ( @@ -33,7 +36,7 @@ function App() { onChange={(e) => setUrl(e.currentTarget.value)} placeholder="Enter a URL..." /> - + {responseBody !== null && ( <> @@ -44,7 +47,12 @@ function App() {  •  {responseBody?.elapsed2}ms - +
+ +
+