Skip to content

Commit

Permalink
Fix bug with empty rows
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin committed Feb 18, 2022
1 parent 1c2a0e9 commit bde34dc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mavo-gsheets.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Google Sheets backend plugin for Mavo
* @author Dmitry Sharabin and contributors
* @version 1.0.4
* @version 1.0.5
*/

(($, $f) => {
Expand Down Expand Up @@ -228,7 +228,14 @@
// Search for the first fully empty row.
for (let row = startRow; row < rawValues.length; row++) {
const r = rawValues[row];
const isEmpty = r?.every((cell, index) => index <= endColumn && !cell?.effectiveValue);

let isEmpty = true;
for (let column = startColumn; column <= endColumn; column++) {
if (r?.[column]?.effectiveValue) {
isEmpty = false;
break;
}
}

if (!r || isEmpty) {
endRow = row - 1;
Expand Down

0 comments on commit bde34dc

Please sign in to comment.