Skip to content

Commit

Permalink
fix: also allow x-zip-compressed mime types
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelblijleven committed Oct 17, 2023
1 parent 27d0f62 commit a952673
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/beanconqueror/stats/components/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Process = (props: ProcessProps) => {

if (props.file.type === "application/json") {
readTextFile(props.file, props.callback)
} else if (props.file.type === "application/zip") {
} else if (props.file.type === "application/zip" || props.file.type === "application/x-zip-compressed") {
readZipFileWithCallback(props.file, props.callback).catch(err => {
console.error(err);
toast({
Expand Down
7 changes: 6 additions & 1 deletion src/app/coffee/import/actions/import-beanconqueror.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import {importBeans} from "./utils";
import {currentUser} from "@clerk/nextjs/server";

function checkFile(file: File) {
if (!file.type || file.type === "application/zip") {
const zipTypes = [
"application/zip",
"application/x-zip-compressed",
]

if (!file.type || zipTypes.includes(file.type)) {
// File type can be empty on Windows, apparently
return true;
}
Expand Down

0 comments on commit a952673

Please sign in to comment.