From 19303e7a906e20d040245426779609c0dd10590d Mon Sep 17 00:00:00 2001 From: Viranch Mehta Date: Sun, 5 Mar 2023 01:30:42 -0800 Subject: [PATCH] Filter down the list of sheets to grid-type only, fixes #107 --- src/integrations/google/googleIntegration.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/integrations/google/googleIntegration.ts b/src/integrations/google/googleIntegration.ts index 3529b536..3a478f93 100644 --- a/src/integrations/google/googleIntegration.ts +++ b/src/integrations/google/googleIntegration.ts @@ -75,8 +75,11 @@ export class GoogleIntegration { return this.sheets .get({ spreadsheetId: documentId || this.googleConfig.documentId }) .then(res => { - logInfo(`Fetched ${res.data.sheets.length} sheets.`, res.data.sheets) - return res.data.sheets + let sheets = res.data.sheets + logInfo(`Fetched ${sheets.length} sheets.`, sheets) + sheets = sheets.filter(s => s.properties.sheetType == 'GRID') + logInfo(`${sheets.length} grid-type sheets`) + return sheets }) .catch(error => { logError(`Error fetching sheets for spreadsheet ${this.googleConfig.documentId}.`, error)