mirror of
https://github.com/open-webui/open-webui
synced 2025-01-01 08:42:14 +00:00
fix: Declare finalFileName to resolve Google Drive picker error
This commit is contained in:
parent
886fb3f426
commit
51061afb10
@ -125,6 +125,7 @@ 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
|
||||||
@ -132,9 +133,8 @@ 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';
|
||||||
// Create new filename with .xlsx extension for spreadsheets if needed
|
// Update filename with .xlsx extension for spreadsheets if needed
|
||||||
const finalFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`;
|
finalFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`;
|
||||||
// Use finalFileName in the result object later
|
|
||||||
} 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user