Prechádzať zdrojové kódy

fix: Simplify Google Drive file upload handling for spreadsheets

Taylor Wilsdon (aider) 4 mesiacov pred
rodič
commit
31f499af0e
1 zmenil súbory, kde vykonal 1 pridanie a 4 odobranie
  1. 1 4
      src/lib/utils/google-drive-picker.ts

+ 1 - 4
src/lib/utils/google-drive-picker.ts

@@ -125,7 +125,6 @@ export const createPicker = () => {
 
 
                             let downloadUrl;
                             let downloadUrl;
                             let exportFormat;
                             let exportFormat;
-                            let finalFileName = fileName; // Initialize with original filename
                             
                             
                             if (mimeType.includes('google-apps')) {
                             if (mimeType.includes('google-apps')) {
                                 // Handle Google Workspace files
                                 // Handle Google Workspace files
@@ -133,8 +132,6 @@ export const createPicker = () => {
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
                                 } else if (mimeType.includes('spreadsheet')) {
                                 } else if (mimeType.includes('spreadsheet')) {
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
-                                    // Update filename with .xlsx extension for spreadsheets if needed
-                                    finalFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`;
                                 } else if (mimeType.includes('presentation')) {
                                 } else if (mimeType.includes('presentation')) {
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
                                     exportFormat = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
                                 } else {
                                 } else {
@@ -166,7 +163,7 @@ export const createPicker = () => {
                             const blob = await response.blob();
                             const blob = await response.blob();
                             const result = {
                             const result = {
                                 id: fileId,
                                 id: fileId,
-                                name: finalFileName || fileName, // Use modified filename if available
+                                name: fileName,
                                 url: downloadUrl,
                                 url: downloadUrl,
                                 blob: blob,
                                 blob: blob,
                                 headers: {
                                 headers: {