mirror of
https://github.com/open-webui/open-webui.git
synced 2026-01-04 23:55:22 +00:00
fix/refac: temp chat image handling
This commit is contained in:
parent
4ab917c74b
commit
423983f5a7
1 changed files with 13 additions and 3 deletions
|
|
@ -731,10 +731,20 @@
|
|||
imageUrl = await compressImageHandler(imageUrl, $settings, $config);
|
||||
}
|
||||
|
||||
const blob = await (await fetch(imageUrl)).blob();
|
||||
const compressedFile = new File([blob], file.name, { type: file.type });
|
||||
if ($temporaryChatEnabled) {
|
||||
files = [
|
||||
...files,
|
||||
{
|
||||
type: 'image',
|
||||
url: imageUrl
|
||||
}
|
||||
];
|
||||
} else {
|
||||
const blob = await (await fetch(imageUrl)).blob();
|
||||
const compressedFile = new File([blob], file.name, { type: file.type });
|
||||
|
||||
uploadFileHandler(compressedFile, false);
|
||||
uploadFileHandler(compressedFile, false);
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file['type'] === 'image/heic' ? await convertHeicToJpeg(file) : file);
|
||||
|
|
|
|||
Loading…
Reference in a new issue