Skip to content

Commit a5a7a37

Browse files
committed
Fix bug where data remained if filter removed everything
1 parent 66ad858 commit a5a7a37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/maps/@id/edit/edit-table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default function TableInterface({ url }: EditTableProps) {
148148
return typeof p == "object" && p.length > 0 ? p : Object.keys(data[0])
149149
})
150150

151-
// Apply tableupdates to the data
151+
// Apply table updates to the data
152152
data = applyTableUpdates(data, tableUpdates)
153153

154154
if(data.length == 0){
@@ -162,7 +162,7 @@ export default function TableInterface({ url }: EditTableProps) {
162162

163163
// Set the table ref
164164
ref.current = Array.from({ length: data.length == 0 ? 1 : data.length }, () =>
165-
Array.from({ length: Object.keys(data[0]).length == 0 ? 1 : Object.keys(data[0]).length }, () => null)
165+
Array.from({ length: data.length == 0 ? 1 : Object.keys(data[0]).length }, () => null)
166166
);
167167

168168
return data

0 commit comments

Comments
 (0)