Skip to content

Commit

Permalink
fix: Fixed the problem that text type files cannot be uploaded normally
Browse files Browse the repository at this point in the history
  • Loading branch information
Amery2010 committed Feb 9, 2025
1 parent 726b39d commit f26a985
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ A cross-platform application client that supports a permanent menu bar, doubling
## Get Started

1. Get [Gemini API Key](https://aistudio.google.com/app/apikey)
2. One-click deployment of the project, you can choose to deploy to Vercel or Cloudflare
2. One-click deployment of the project, you can choose to deploy to Vercel

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fu14app%2Fgemini-next-chat&project-name=gemini-next-chat&env=GEMINI_API_KEY&env=ACCESS_PASSWORD&repository-name=gemini-next-chat)

Expand Down Expand Up @@ -154,7 +154,7 @@ Supports multiple keys, each key is separated by `,`, i.e. `key1,key2,key3`
> Examples: `http://your-gemini-proxy.com`
Override the Gemini api request base url. **In order to avoid server-side proxy url leakage, the value in the front-end page will not be overwritten and affected. **
Override the Gemini api request base url. **In order to avoid server-side proxy url leakage, the value in the front-end page will not be overwritten and affected.**

#### `NEXT_PUBLIC_GEMINI_MODEL_LIST` (optional)

Expand Down
10 changes: 4 additions & 6 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,13 @@ export default function Home() {
const file = files[i]
if (mimeType.includes(file.type)) {
if (isOfficeFile(file.type)) {
const data = await parseOffice(file, { type: 'file' })
if (Array.isArray(data)) {
data.forEach((item) => {
fileList.push(item)
})
}
const newFile = await parseOffice(file, { type: 'file' })
if (newFile instanceof File) fileList.push(newFile)
} else {
fileList.push(file)
}
} else if (file.type.startsWith('text/')) {
fileList.push(file)
}
}

Expand Down
2 changes: 2 additions & 0 deletions components/FileUploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function FileUploader({ beforeUpload, afterUpload }: Props) {
} else {
fileList.push(file)
}
} else if (file.type.startsWith('text/')) {
fileList.push(file)
}
}
}
Expand Down

0 comments on commit f26a985

Please sign in to comment.