Skip to content

Commit 4ba547c

Browse files
committed
fix: ConfigMapSecret - fix incorrect error state
1 parent 2aa59f1 commit 4ba547c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/Pages/Shared/ConfigMapSecret/ConfigMapSecretContainer.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,6 @@ export const ConfigMapSecretContainer = ({
328328
}
329329
}, [configMapSecretResLoading, configMapSecretRes])
330330

331-
// CONFIGMAP/SECRET DELETED
332-
const configHasBeenDeleted = useMemo(
333-
() =>
334-
!configMapSecretResLoading && configMapSecretRes
335-
? !configMapSecretData && !inheritedConfigMapSecretData && !draftData
336-
: null,
337-
[configMapSecretResLoading, configMapSecretRes],
338-
)
339-
340331
// CONFIGMAP/SECRET ERROR
341332
const configMapSecretResErr = useMemo(
342333
() =>
@@ -348,6 +339,18 @@ export const ConfigMapSecretContainer = ({
348339
[configMapSecretResLoading, configMapSecretRes],
349340
)
350341

342+
// CONFIGMAP/SECRET DELETED
343+
const configHasBeenDeleted = useMemo(
344+
() =>
345+
!configMapSecretResLoading &&
346+
configMapSecretRes &&
347+
!configMapSecretResErr &&
348+
!configMapSecretData &&
349+
!inheritedConfigMapSecretData &&
350+
!draftData,
351+
[configMapSecretResLoading, configMapSecretRes, configMapSecretResErr],
352+
)
353+
351354
// ASYNC CALL - CONFIGMAP/SECRET RESOLVED DATA
352355
const [resolvedScopeVariablesResLoading, resolvedScopeVariablesRes, reloadResolvedScopeVariablesResErr] = useAsync(
353356
() =>

0 commit comments

Comments
 (0)