Skip to content

Commit efc5c03

Browse files
committed
fix: review comments
1 parent 054c9ee commit efc5c03

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

src/Shared/Components/AppStatusModal/AppStatusBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const AppStatusBody = ({ appDetails, type, handleShowConfigDriftModal }:
3232
const customMessage =
3333
type === 'stack-manager'
3434
? 'The installation will complete when status for all the below resources become HEALTHY.'
35-
: APP_STATUS_CUSTOM_MESSAGES[appDetails.resourceTree?.status?.toUpperCase()]
35+
: APP_STATUS_CUSTOM_MESSAGES[appStatus]
3636

3737
const infoCardItems: (Omit<ComponentProps<typeof InfoCardItem>, 'isLast'> & { id: number })[] = [
3838
{

src/Shared/Components/AppStatusModal/AppStatusModal.component.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ const AppStatusModal = ({
4949

5050
const handleExternalSync = async () => {
5151
try {
52-
const response = await getAppDetailsWrapper()
53-
setFetchedAppDetails(response)
54-
5552
pollingTimeoutRef.current = setTimeout(
56-
() => {
53+
async () => {
54+
const response = await getAppDetailsWrapper()
55+
setFetchedAppDetails(response)
5756
// eslint-disable-next-line @typescript-eslint/no-floating-promises
5857
handleExternalSync()
5958
},
@@ -77,13 +76,8 @@ const AppStatusModal = ({
7776
fetchedAppDetails &&
7877
!pollingTimeoutRef.current
7978
) {
80-
pollingTimeoutRef.current = setTimeout(
81-
() => {
82-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
83-
handleExternalSync()
84-
},
85-
Number(window._env_.DEVTRON_APP_DETAILS_POLLING_INTERVAL) || 30000,
86-
)
79+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
80+
handleExternalSync()
8781
}
8882

8983
return () => {

src/Shared/Components/AppStatusModal/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const getAppDetails = async (
3030
appType: AppType.DEVTRON_APP,
3131
}
3232
} catch (error) {
33-
if (getIsRequestAborted(error)) {
33+
if (!getIsRequestAborted(error)) {
3434
showError(error)
3535
}
3636
throw error

src/Shared/Components/AppStatusModal/utils.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ export const getAppStatusMessageFromAppDetails = (appDetails: AppDetails): strin
1010
return ''
1111
}
1212

13+
const { conditions } = appDetails.resourceTree
14+
15+
if (Array.isArray(conditions) && conditions.length > 0 && conditions[0].message) {
16+
return conditions[0].message
17+
}
18+
1319
const nodes: AggregatedNodes = aggregateNodes(
1420
appDetails.resourceTree.nodes || [],
1521
appDetails.resourceTree.podMetadata || [],
1622
)
1723

18-
const { conditions } = appDetails.resourceTree
1924
const rollout = nodes?.nodes?.Rollout?.entries()?.next()?.value?.[1]
2025

21-
if (Array.isArray(conditions) && conditions.length > 0 && conditions[0].message) {
22-
return conditions[0].message
23-
}
24-
2526
if (rollout?.health?.message) {
2627
return rollout.health.message
2728
}

0 commit comments

Comments
 (0)