fix/refac: temp chat image handling

This commit is contained in:
Timothy Jaeryang Baek 2025-12-22 09:48:53 +04:00
parent 4ab917c74b
commit 423983f5a7

View file

@ -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);