mirror of
https://github.com/open-webui/open-webui
synced 2025-01-01 08:42:14 +00:00
fix: Prevent constant reassignment in Google Drive file picker
This commit is contained in:
parent
f919f63d33
commit
886fb3f426
@ -132,9 +132,9 @@ 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
|
||||
const modifiedFileName = fileName.endsWith('.xlsx') ? fileName : `${fileName}.xlsx`;
|
||||
fileName = modifiedFileName;
|
||||
// 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
|
||||
} else if (mimeType.includes('presentation')) {
|
||||
exportFormat = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
|
||||
} else {
|
||||
@ -166,7 +166,7 @@ export const createPicker = () => {
|
||||
const blob = await response.blob();
|
||||
const result = {
|
||||
id: fileId,
|
||||
name: fileName,
|
||||
name: finalFileName || fileName, // Use modified filename if available
|
||||
url: downloadUrl,
|
||||
blob: blob,
|
||||
headers: {
|
||||
|
Loading…
Reference in New Issue
Block a user