Skip to content

Commit

Permalink
feat(UI): no invalidation on new overview (#2078)
Browse files Browse the repository at this point in the history
Ref: SRX-E9K6SV

Co-authored-by: Sven Urbanski <[email protected]>
  • Loading branch information
1 parent b6392fe commit 3b98adc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions services/frontend-service/src/ui/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { PageRoutes } from './PageRoutes';
import '../../assets/app-v2.scss';
import * as React from 'react';
import {
AppDetailsResponse,
AppDetailsState,
EnableRolloutStatus,
FlushRolloutStatus,
Expand Down Expand Up @@ -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 }) });
Expand Down

0 comments on commit 3b98adc

Please sign in to comment.