Fixed data being undefined.

This commit is contained in:
Mike Cao 2023-05-16 19:31:40 -07:00
parent e98c0a62e3
commit b663146ad5

View File

@ -73,13 +73,13 @@ export function MetricsTable({
const filteredData = useMemo(() => {
if (data) {
let items;
let items = data;
if (dataFilter) {
if (Array.isArray(dataFilter)) {
items = dataFilter.reduce((arr, filter) => {
return filter(arr);
}, data);
}, items);
} else {
items = dataFilter(data);
}