From 51061afb108df7b765eb3fd75d828554360e5fec Mon Sep 17 00:00:00 2001 From: "Taylor Wilsdon (aider)" Date: Mon, 16 Dec 2024 10:58:47 -0500 Subject: [PATCH] fix: Declare finalFileName to resolve Google Drive picker error --- src/lib/utils/google-drive-picker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/utils/google-drive-picker.ts b/src/lib/utils/google-drive-picker.ts index 90d34c9e2..09c3431bc 100644 --- a/src/lib/utils/google-drive-picker.ts +++ b/src/lib/utils/google-drive-picker.ts @@ -125,6 +125,7 @@ export const createPicker = () => { let downloadUrl; let exportFormat; + let finalFileName = fileName; // Initialize with original filename if (mimeType.includes('google-apps')) { // Handle Google Workspace files @@ -132,9 +133,8 @@ export const createPicker = () => { exportFormat = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; } else if (mimeType.includes('spreadsheet')) { exportFormat = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; - // Create new filename with .xlsx extension for spreadsheets if needed - const finalFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`; - // Use finalFileName in the result object later + // Update filename with .xlsx extension for spreadsheets if needed + finalFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`; } else if (mimeType.includes('presentation')) { exportFormat = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; } else {