mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-17 14:46:00 +08:00
refactor: Remove verbose logging from file upload handlers
This commit is contained in:
parent
7699db0666
commit
0563239782
@ -90,11 +90,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const uploadFileHandler = async (file) => {
|
const uploadFileHandler = async (file) => {
|
||||||
console.log('Upload file handler called with:', {
|
|
||||||
name: file.name,
|
|
||||||
type: file.type,
|
|
||||||
size: file.size
|
|
||||||
});
|
|
||||||
|
|
||||||
const tempItemId = uuidv4();
|
const tempItemId = uuidv4();
|
||||||
const fileItem = {
|
const fileItem = {
|
||||||
@ -111,7 +106,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (fileItem.size == 0) {
|
if (fileItem.size == 0) {
|
||||||
console.log('Attempted to upload empty file:', fileItem.name);
|
|
||||||
toast.error($i18n.t('You cannot upload an empty file.'));
|
toast.error($i18n.t('You cannot upload an empty file.'));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -521,27 +515,12 @@
|
|||||||
}}
|
}}
|
||||||
uploadGoogleDriveHandler={async () => {
|
uploadGoogleDriveHandler={async () => {
|
||||||
try {
|
try {
|
||||||
console.log('Starting Google Drive file selection...');
|
|
||||||
const fileData = await createPicker();
|
const fileData = await createPicker();
|
||||||
console.log('Picker returned file data:', fileData);
|
|
||||||
if (fileData) {
|
if (fileData) {
|
||||||
console.log('Preparing to dispatch upload event with:', {
|
|
||||||
id: fileData.id,
|
|
||||||
name: fileData.name,
|
|
||||||
url: fileData.url,
|
|
||||||
headers: fileData.headers // Use the actual headers from the picker
|
|
||||||
});
|
|
||||||
// Create a File object from the blob with proper name
|
|
||||||
const file = new File([fileData.blob], fileData.name, {
|
const file = new File([fileData.blob], fileData.name, {
|
||||||
type: fileData.blob.type
|
type: fileData.blob.type
|
||||||
});
|
});
|
||||||
console.log('Created File object:', {
|
|
||||||
name: file.name,
|
|
||||||
size: file.size,
|
|
||||||
type: file.type
|
|
||||||
});
|
|
||||||
await uploadFileHandler(file);
|
await uploadFileHandler(file);
|
||||||
console.log('Upload event dispatched');
|
|
||||||
} else {
|
} else {
|
||||||
console.log('No file was selected from Google Drive');
|
console.log('No file was selected from Google Drive');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user