Skip to content

Commit e5717e6

Browse files
committed
update getRowId
1 parent 00bdfa4 commit e5717e6

File tree

1 file changed

+5
-4
lines changed
  • packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/explore

1 file changed

+5
-4
lines changed

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/explore/TablesViewer.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
TriangleAlertIcon,
99
} from "lucide-react";
1010
import { parseAsJson, parseAsString, useQueryState } from "nuqs";
11+
import { keccak256, toHex } from "viem";
1112
import { useCallback, useMemo } from "react";
1213
import { Table as TableType } from "@latticexyz/config";
1314
import { getKeySchema } from "@latticexyz/protocol-parser/internal";
@@ -126,10 +127,10 @@ export function TablesViewer({ table, isLiveQuery }: Props) {
126127
},
127128
manualPagination: true,
128129
pageCount: -1,
129-
getRowId: (row, idx) =>
130-
`${idx}-${Object.entries(row)
131-
.map(([key, value]) => `${key}:${value}`)
132-
.join("-")}`,
130+
getRowId: (row) => {
131+
const values = Object.values(row).join("-");
132+
return keccak256(toHex(`${query}-${values}`));
133+
},
133134
onSortingChange: setSorting,
134135
onPaginationChange: handlePaginationChange,
135136
getCoreRowModel: getCoreRowModel(),

0 commit comments

Comments
 (0)