From b54926e9874d879f364fb6e707920b112a26342f Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Wed, 6 Dec 2023 16:57:21 -0800 Subject: [PATCH] Image filetype support, 100% of what openai allows, ignore caps --- .vscode/settings.json | 5 +++++ src/components/Chat/ChatInput.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..ba419406c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "availble" + ] +} \ No newline at end of file diff --git a/src/components/Chat/ChatInput.tsx b/src/components/Chat/ChatInput.tsx index 47c92414a..0e429e928 100644 --- a/src/components/Chat/ChatInput.tsx +++ b/src/components/Chat/ChatInput.tsx @@ -352,7 +352,7 @@ export const ChatInput = ({ const validImageTypes = ['.jpg', '.jpeg', '.png']; const isImageValid = (fileName: string): boolean => { - const ext = fileName.slice(((fileName.lastIndexOf(".") - 1) >>> 0) + 2); + const ext = fileName.slice(((fileName.lastIndexOf(".") - 1) >>> 0) + 2).toLowerCase(); return validImageTypes.includes(`.${ext}`); } @@ -467,7 +467,7 @@ export const ChatInput = ({ withCloseButton: true, onClose: () => console.log('error unmounted'), onOpen: () => console.log('error mounted'), - autoClose: 4000, + autoClose: 8000, title: 'Invalid Image Type', message: 'Unsupported file type. Please upload .jpg or .png images.', color: 'red',