diff --git a/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx b/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx index b32c081a44..575c3fd963 100644 --- a/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx +++ b/packages/libs/eda/src/lib/core/components/computations/plugins/correlation.tsx @@ -534,13 +534,13 @@ function isEnabledInPicker({ // Find all variables in any collection, then remove them from the // list of all variables to get a list of metadata variables. - const variablesInACollection = entities[0].collections?.flatMap( - (collection) => { + const variablesInACollection = new Set( + entities[0].collections?.flatMap((collection) => { return collection.memberVariableIds; - } + }) ); metadataVariables = entities[0].variables.filter((variable) => { - return !variablesInACollection?.includes(variable.id); + return !variablesInACollection.has(variable.id); }); } diff --git a/packages/libs/eda/src/lib/core/components/computations/plugins/correlationAssayMetadata.tsx b/packages/libs/eda/src/lib/core/components/computations/plugins/correlationAssayMetadata.tsx index 0f15b144ec..e01ac32ee6 100644 --- a/packages/libs/eda/src/lib/core/components/computations/plugins/correlationAssayMetadata.tsx +++ b/packages/libs/eda/src/lib/core/components/computations/plugins/correlationAssayMetadata.tsx @@ -411,13 +411,13 @@ function isEnabledInPicker({ // Find all variables in any collection, then remove them from the // list of all variables to get a list of metadata variables. - const variablesInACollection = entities[0].collections?.flatMap( - (collection) => { + const variablesInACollection = new Set( + entities[0].collections?.flatMap((collection) => { return collection.memberVariableIds; - } + }) ); metadataVariables = entities[0].variables.filter((variable) => { - return !variablesInACollection?.includes(variable.id); + return !variablesInACollection.has(variable.id); }); }