From 78290165b212a4954dbd9fc57e83bb86012cb47d Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Tue, 22 Feb 2022 06:29:41 +0000 Subject: [PATCH] dashboard: set correct default setting for telemetry Fixes https://github.com/gitpod-io/gitpod/issues/8344 `Enable Service Ping` seems to be set to `false` by defaut until the UI is re-loaded. This fixes it by also adding the retrieval logic into `useEffect` thereby calling it everytime, even during initial render. Signed-off-by: Tarun Pothulapati --- components/dashboard/src/admin/Settings.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/dashboard/src/admin/Settings.tsx b/components/dashboard/src/admin/Settings.tsx index d571f887254d62..948f1c76734e36 100644 --- a/components/dashboard/src/admin/Settings.tsx +++ b/components/dashboard/src/admin/Settings.tsx @@ -25,8 +25,11 @@ export default function Settings() { (async () => { const data = await getGitpodService().server.adminGetTelemetryData(); setTelemetryData(data) + + const setting = await getGitpodService().server.adminGetSettings(); + setAdminSettings(setting) })(); - }); + }, []); if (!user || !user?.rolesOrPermissions?.includes('admin')) { return