From b3e8555925f21cdb60c21a055f58d5337b983b20 Mon Sep 17 00:00:00 2001 From: Thomas Schoffelen Date: Sat, 7 Sep 2024 15:17:48 +0100 Subject: [PATCH] fix: map doesn't exist on set keys in Safari --- .../dashboard/src/components/tables/data-table-filter.tsx | 6 +++++- packages/dashboard/src/routes/functions/columns.tsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/src/components/tables/data-table-filter.tsx b/packages/dashboard/src/components/tables/data-table-filter.tsx index 94c1eee..568f1d1 100644 --- a/packages/dashboard/src/components/tables/data-table-filter.tsx +++ b/packages/dashboard/src/components/tables/data-table-filter.tsx @@ -40,7 +40,11 @@ export function DataTableFilter({ const selectedValues = new Set(column?.getFilterValue() as string[]); options = Array.from( - options || facets?.keys?.().map((value) => ({ value, label: value })) || [], + options || + Array.from(facets?.keys() || []).map((value) => ({ + value, + label: value, + })), ); return ( diff --git a/packages/dashboard/src/routes/functions/columns.tsx b/packages/dashboard/src/routes/functions/columns.tsx index b32032a..1e26d5a 100644 --- a/packages/dashboard/src/routes/functions/columns.tsx +++ b/packages/dashboard/src/routes/functions/columns.tsx @@ -112,7 +112,7 @@ export const columns: ColumnDef[] = [ } } - return tags?.keys?.()?.map((tag) => ({ value: tag, label: tag })); + return Array.from(tags.keys()).map((tag) => ({ value: tag, label: tag })); }, filterFn: (row, id, value) => { return value.every((v) => row.getValue(id)?.includes(v));