Skip to content

Commit

Permalink
fix: table walker
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed May 21, 2024
1 parent 82b8726 commit 3bfa424
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/graphic-walker/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ export const TableApp = observer(function VizApp(props: BaseTableProps) {
);

const metas = toJS(vizStore.meta);

const [portal, setPortal] = useState<HTMLDivElement | null>(null);

const datasets = Array.from(new Set(metas.map((x) => x.dataset ?? DEFAULT_DATASET)));
const [dataset, setDataset] = useState(datasets[0] ?? DEFAULT_DATASET);
const tableMeta = metas.filter((x) => dataset === (x.dataset ?? DEFAULT_DATASET));

return (
<ErrorContext value={{ reportError }}>
Expand Down Expand Up @@ -107,7 +109,7 @@ export const TableApp = observer(function VizApp(props: BaseTableProps) {
: undefined
}
size={pageSize}
metas={metas}
metas={tableMeta}
computation={wrappedComputation}
displayOffset={props.displayOffset}
/>
Expand Down

0 comments on commit 3bfa424

Please sign in to comment.