Skip to content

Commit 6db1b5b

Browse files
authored
Merge pull request #1595 from devtron-labs/prod-bug-for-config-api-rendering
fix: Prod bug for config api rendering
2 parents be9fdea + 8b4c2e0 commit 6db1b5b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/components/ApplicationGroup/Details/TriggerView/EnvTriggerView.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
140140
const handledLocation = useRef(false)
141141
const abortControllerRef = useRef(new AbortController())
142142

143-
useEffect(
144-
() => () => {
143+
useEffect(() => {
144+
getConfigs()
145+
return () => {
145146
handledLocation.current = false
146-
},
147-
[],
148-
)
147+
}
148+
}, [])
149149

150150
useEffect(() => {
151151
if (envId) {
@@ -165,20 +165,18 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
165165
// URL Encoding for Bulk is not planned as of now
166166
setShowBulkCDModal(false)
167167
if (location.search.includes('approval-node')) {
168-
getConfigs()
169168
const searchParams = new URLSearchParams(location.search)
170169
const nodeId = Number(searchParams.get('approval-node'))
171170
if (!isNaN(nodeId)) {
172171
onClickCDMaterial(nodeId, DeploymentNodeType.CD, true)
173-
}
174-
else {
172+
} else {
175173
toast.error('Invalid node id')
176174
history.push({
177175
search: '',
178176
})
179177
}
180-
}
181-
else if (location.search.includes('rollback-node')) {
178+
}
179+
else if (location.search.includes('rollback-node')) {
182180
const searchParams = new URLSearchParams(location.search)
183181
const nodeId = Number(searchParams.get('rollback-node'))
184182
if (!isNaN(nodeId)) {

0 commit comments

Comments
 (0)