Skip to content

Commit f48d7c4

Browse files
committed
chore: move isArgoCDAvailable out of from for loop
1 parent 9940cba commit f48d7c4

File tree

1 file changed

+5
-4
lines changed
  • src/components/app/details/appDetails

1 file changed

+5
-4
lines changed

src/components/app/details/appDetails/utils.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,11 @@ export const processDeploymentStatusDetailsData = (
504504

505505
// data when timelines is available
506506
if (data?.timelines?.length) {
507+
// TO Support legacy data have to make sure that if ARGOCD_SYNC is not available then we fill it with dummy values
508+
const isArgoCDAvailable = data.timelines.some((timeline) =>
509+
timeline['status'].includes(TIMELINE_STATUS.ARGOCD_SYNC),
510+
)
511+
507512
for (let index = data.timelines.length - 1; index >= 0; index--) {
508513
const element = data.timelines[index]
509514
if (element['status'] === TIMELINE_STATUS.HEALTHY || element['status'] === TIMELINE_STATUS.DEGRADED) {
@@ -607,10 +612,6 @@ export const processDeploymentStatusDetailsData = (
607612
})
608613
}
609614

610-
// TO Support legacy data have to make sure that if ARGOCD_SYNC is not available then we fill it with dummy values
611-
const isArgoCDAvailable = data?.timelines?.some((timeline) =>
612-
timeline['status'].includes(TIMELINE_STATUS.ARGOCD_SYNC),
613-
)
614615
if (!isArgoCDAvailable) {
615616
deploymentData.deploymentStatusBreakdown.ARGOCD_SYNC.icon = 'success'
616617
deploymentData.deploymentStatusBreakdown.ARGOCD_SYNC.displaySubText = ''

0 commit comments

Comments
 (0)