From c5e699a29e00f0c2a4d532397503687147b17660 Mon Sep 17 00:00:00 2001 From: Eugene Lee Date: Tue, 19 Apr 2022 10:33:25 -0700 Subject: [PATCH] Saved mainVisId before setting all to loading Signed-off-by: Eugene Lee --- .../public/components/application_analytics/home.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dashboards-observability/public/components/application_analytics/home.tsx b/dashboards-observability/public/components/application_analytics/home.tsx index be405fa03..d3074da8b 100644 --- a/dashboards-observability/public/components/application_analytics/home.tsx +++ b/dashboards-observability/public/components/application_analytics/home.tsx @@ -200,7 +200,9 @@ export const Home = (props: HomeProps) => { .get(`${APP_ANALYTICS_API_PREFIX}/`) .then(async (res) => { // Want to calculate availability going down the table + const mainVisIdStore: Record = {}; for (let i = 0; i < res.data.length; i++) { + mainVisIdStore[res.data[i].id] = res.data[i].availability.mainVisId; res.data[i].availability = { name: 'loading', color: '', mainVisId: '' }; } setApplicationList(res.data); @@ -209,7 +211,7 @@ export const Home = (props: HomeProps) => { http, pplService, res.data[i], - res.data[i].availability.mainVisId, + mainVisIdStore[res.data[i].id], () => {} ); // Need to set state with new object to trigger re-render