diff --git a/app/src/components/FileProvider.tsx b/app/src/components/FileProvider.tsx index f109198..7127700 100644 --- a/app/src/components/FileProvider.tsx +++ b/app/src/components/FileProvider.tsx @@ -42,7 +42,7 @@ function FileProvider({ value, onChange }: FileProviderProps) { function addFile(file: FileObject) { console.debug( - `[file] new file was added (filename: ${file.name}, size: ${file.content.length})`, + `[file] new file was added (filename: ${file.name}, size: ${file.size}, prompt: ${file.content.length})`, ); if ( file.content.length > MaxPromptSize && @@ -99,7 +99,7 @@ function FileList({ value, removeFile }: FileListProps) { const [full, setFull] = useState(false); const file = useMemo(() => value[0], [value]); const size = useMemo( - () => value.reduce((acc, cur) => acc + cur.content.length, 0), + () => value.reduce((acc, cur) => acc + (cur.size || cur.content.length), 0), [value], ); @@ -130,7 +130,7 @@ function FileList({ value, removeFile }: FileListProps) {