Skip to content

Commit

Permalink
feat: support multiple file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Mar 18, 2024
1 parent d183ed3 commit 9151fdf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ Translated with DeepL.com (free version)
- [Golang SDK](https://github.com/Deeptrain-Community/chatnio-api-go)
- [Java SDK](https://github.com/hujiayucc/ChatNio-SDK-Java) (Thanks to [@hujiayucc](https://github.com/hujiayucc))
- [PHP SDK](https://github.com/hujiayucc/ChatNio-SDK-Php) (Thanks to [@hujiayucc](https://github.com/hujiayucc))
## ✨ Some EXCELLENT Open-source Projects
> **Frontend projects here refer to projects that focus on user chat interfaces, backend projects refer to projects that focus on API transfer and management, and one-stop projects refer to projects that include user chat interfaces and API transfer and management**
- [Next Chat @yidadaa](https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web) (Front-end Oriented Projects)
Expand All @@ -296,7 +297,7 @@ Translated with DeepL.com (free version)
- [FastGPT @labring](https://github.com/labring/FastGPT) (Knowledge Base)
- [Quivr @quivrhq](https://github.com/StanGirard/quivr) (Knowledge Base)
- [Bingo @weaigc](https://github.com/weaigc/bingo) (Knowledge Base)
- [Midjourney Proxy @novicezk](https://github.com/novicezk/midjourney-proxy) (Knowledge Base
- [Midjourney Proxy @novicezk](https://github.com/novicezk/midjourney-proxy) (Model Library
## 📄 Open Source License
Expand Down
1 change: 1 addition & 0 deletions app/src/components/FileProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ function FileInput({ id, loading, className, handleEvent }: FileInputProps) {
onChange={(e) => handleEvent(Array.from(e.target?.files || []))}
accept="*"
style={{ display: "none" }}
multiple={true}
// on transfer file
onPaste={(e) => {
const items = e.clipboardData.items;
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/home/ChatWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function fileReducer(state: FileArray, action: Record<string, any>): FileArray {
case "add":
return [...state, action.payload];
case "remove":
return state.filter((file) => file !== action.payload);
return state.filter((_, i) => i !== action.payload);
case "clear":
return [];
default:
Expand Down

0 comments on commit 9151fdf

Please sign in to comment.