Merge pull request #18496 from ShirasawaSama/patch-44

fix: Clear file list when selected models do not support file uploads
This commit is contained in:
Tim Baek 2025-10-21 16:36:05 -04:00 committed by GitHub
commit b68a5f330d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,6 +55,10 @@
$: fileUploadEnabled =
fileUploadCapableModels.length === selectedModels.length &&
($user?.role === 'admin' || $user?.permissions?.chat?.file_upload);
$: if (!fileUploadEnabled && files.length > 0) {
files = [];
}
const detectMobile = () => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera;