Skip to content

Commit bcdede1

Browse files
author
Dylan Huang
committed
make sure we show all keys from all rows
1 parent 42a0b3c commit bcdede1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vite-app/src/GlobalState.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ export class GlobalState {
109109
}
110110

111111
get flattenedDatasetKeys() {
112-
if (this.flattenedDataset.length === 0) return [];
113-
return Object.keys(this.flattenedDataset[0]);
112+
const keySet = new Set<string>();
113+
this.flattenedDataset.forEach((row) => {
114+
Object.keys(row).forEach((key) => keySet.add(key));
115+
});
116+
return Array.from(keySet);
114117
}
115118

116119
get totalCount() {

0 commit comments

Comments
 (0)