Fix: UI secret import indicator

This commit is contained in:
Daniel Hougaard
2024-03-20 21:09:54 +01:00
parent 6363e7d30a
commit 36adf6863b
2 changed files with 6 additions and 4 deletions
@@ -264,12 +264,13 @@ export const useGetImportedSecretsAllEnvs = ({
});
const isImportedSecretPresentInEnv = useCallback(
(secPath: string, envSlug: string) => {
(secPath: string, envSlug: string, secretName: string) => {
const selectedEnvIndex = environments.indexOf(envSlug);
if (selectedEnvIndex !== -1) {
const isPresent = secretImports?.[selectedEnvIndex]?.data?.find(
({ secretPath }) => secretPath === secPath
({ secretPath, ...rest }) =>
secretPath === secPath && rest.secrets.some((s) => s.key === secretName)
);
return Boolean(isPresent);