Skip to content

Commit fdd995a

Browse files
committed
Fix issue when no rows are returned
Signed-off-by: Liam Barry Allan <[email protected]>
1 parent e6cc1d1 commit fdd995a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/language/results/html.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ exports.generateScroller = (basicSelect) => {
108108
109109
switch (data.command) {
110110
case 'rows':
111-
112111
isFetching = false;
113112
114-
if (scroller.columnDefinitions.length === 0) {
113+
if (data.rows.length > 0 && scroller.columnDefinitions.length === 0) {
115114
scroller.columnDefinitions = Object.keys(data.rows[0]).map(col => ({
116115
title: col,
117116
columnDataKey: col,
@@ -131,7 +130,7 @@ exports.generateScroller = (basicSelect) => {
131130
}
132131
133132
const nextButton = document.getElementById("nextButton");
134-
nextButton.innerText = noMoreRows ? 'End of data' : 'Fetching more...';
133+
nextButton.innerText = noMoreRows ? ('Loaded ' + scroller.rowsData.length + '. End of data') : ('Loaded ' + scroller.rowsData.length + '. Fetching more...');
135134
break;
136135
137136
case 'fetch':

0 commit comments

Comments
 (0)