From 3b98adca51119dbe5f28d09360891358ebd51ee2 Mon Sep 17 00:00:00 2001 From: Miguel Crespo <162333021+miguel-crespo-fdc@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:43:46 +0000 Subject: [PATCH] feat(UI): no invalidation on new overview (#2078) Ref: SRX-E9K6SV Co-authored-by: Sven Urbanski --- .../frontend-service/src/ui/App/index.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/services/frontend-service/src/ui/App/index.tsx b/services/frontend-service/src/ui/App/index.tsx index 656f9c3e5..890eecc75 100644 --- a/services/frontend-service/src/ui/App/index.tsx +++ b/services/frontend-service/src/ui/App/index.tsx @@ -19,7 +19,6 @@ import { PageRoutes } from './PageRoutes'; import '../../assets/app-v2.scss'; import * as React from 'react'; import { - AppDetailsResponse, AppDetailsState, EnableRolloutStatus, FlushRolloutStatus, @@ -103,16 +102,20 @@ export const App: React.FC = () => { UpdateOverview.set({ loaded: true }); PanicOverview.set({ error: '' }); - const newDetails: { [p: string]: AppDetailsResponse } = {}; - result.lightweightApps?.forEach( - (elem) => - (newDetails[elem.name] = { + // When there's an update of the overview + // we keep the app details that we have, + // and add new ones for the apps that we don't know yet: + const details = updateAppDetails.get(); + result.lightweightApps?.forEach((elem) => { + if (!details[elem.name]) { + details[elem.name] = { appDetailState: AppDetailsState.NOTREQUESTED, details: undefined, updatedAt: undefined, - }) - ); - updateAppDetails.set(newDetails); + }; + } + }); + updateAppDetails.set(details); }, (error) => { PanicOverview.set({ error: JSON.stringify({ msg: 'error in streamoverview', error }) });