Skip to content

Commit 2a16789

Browse files
Scott DoverScott Dover
authored andcommitted
chore: infer count when return < 100 results
Signed-off-by: Scott Dover <[email protected]>
1 parent 1c84a9f commit 2a16789

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/src/webview/useDataViewer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ const useDataViewer = (theme: string) => {
135135
return row;
136136
});
137137

138-
params.successCallback(rowData, count);
138+
params.successCallback(
139+
rowData,
140+
// If we've returned less than 100 rows, we can assume that's the last page
141+
// of the data and stop searching.
142+
rowData.length < 100 && count === undefined
143+
? rowData[rowData.length - 1]["#"]
144+
: count,
145+
);
139146
});
140147
},
141148
};

0 commit comments

Comments
 (0)