From c70bd0df07a6845d0b8936a37a9aac4084cd17b6 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 12 Jul 2024 15:10:15 +0200 Subject: [PATCH] Read host name just once Add an empty dependency array to useEffect(), to go back to the behaviour since before commit 4bbb291281556. Thanks to @subhoghoshX for spotting! --- src/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.tsx b/src/app.tsx index 693dd51..0d3b12f 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -32,7 +32,7 @@ export const Application = () => { const hostname = cockpit.file('/etc/hostname'); hostname.watch(content => setHostname(content?.trim() ?? "")); return hostname.close; - }); + }, []); return (