Skip to content

Commit

Permalink
fix: contains file
Browse files Browse the repository at this point in the history
  • Loading branch information
BastinJafari committed Sep 22, 2021
1 parent c609951 commit 7094429
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/showcases/src/pages/e-commerce.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,12 @@ function useJina(url?: BaseURL) {
) {
setResults([])
setError("")
let containsFile = false
documents.forEach(doc => {
if (doc instanceof File) containsFile = true
})
if (!jina) return;
if (!documents.every(doc => doc instanceof File)) {
if (!containsFile) {
setError("Please provide an image!")
return;
}
Expand Down

0 comments on commit 7094429

Please sign in to comment.