fix: added default fallback for selectedColumns, when the attributeKeys call gives empty (#5847)

This commit is contained in:
SagarRajput-7 2024-09-06 11:22:54 +05:30 committed by GitHub
parent b9ab6d3fd4
commit 4214e36d22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,11 @@ const useOptionsMenu = ({
return col;
})
.filter(Boolean) as BaseAutocompleteData[];
// this is the last point where we can set the default columns and if uptil now also we have an empty array then we will set the default columns
if (!initialSelected || !initialSelected?.length) {
initialSelected = defaultTraceSelectedColumns;
}
}
return initialSelected || [];