fix bug: file
This commit is contained in:
parent
3558dc2ed2
commit
311f0e0879
3 changed files with 4 additions and 4 deletions
|
@ -367,7 +367,7 @@ const loadMessages = async (
|
|||
|
||||
document.title = messages[0].content;
|
||||
|
||||
const files = data.chat.files.map((file: any) => {
|
||||
const files = data.chat.files && data.chat.files.map((file: any) => {
|
||||
return {
|
||||
fileName: file.name,
|
||||
fileExtension: file.name.split('.').pop(),
|
||||
|
@ -376,7 +376,7 @@ const loadMessages = async (
|
|||
});
|
||||
|
||||
setFiles(files);
|
||||
setFileIds(files.map((file: File) => file.fileId));
|
||||
setFileIds(files && files.map((file: File) => file.fileId));
|
||||
|
||||
setChatHistory(history);
|
||||
setFocusMode(data.chat.focusMode);
|
||||
|
|
|
@ -55,7 +55,7 @@ const AttachSmall = ({
|
|||
<div className="flex flex-row items-center justify-between space-x-1 p-1">
|
||||
<LoaderCircle size={20} className="text-sky-400 animate-spin" />
|
||||
</div>
|
||||
) : files.length > 0 ? (
|
||||
) : files && files.length > 0 ? (
|
||||
<Popover className="max-w-[15rem] md:max-w-md lg:max-w-lg">
|
||||
<PopoverButton
|
||||
type="button"
|
||||
|
|
|
@ -50,7 +50,7 @@ const focusModes = [
|
|||
},
|
||||
{
|
||||
key: 'translator',
|
||||
title: 'Trasnlator',
|
||||
title: 'Translator',
|
||||
description: 'Chat without searching the web',
|
||||
icon: (
|
||||
<SiGoogletranslate
|
||||
|
|
Loading…
Add table
Reference in a new issue