Skip to content

Commit

Permalink
Fix/82 import (#83)
Browse files Browse the repository at this point in the history
* fix/82-import fix import extension filter
* fix/82-import version bump
  • Loading branch information
cpvalente authored Jan 5, 2022
1 parent 2fa3975 commit c3f18fe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions client/src/features/menu/MenuBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function MenuBar(props) {

const handleUpload = (event) => {
const fileUploaded = event.target.files[0];
console.log('1', fileUploaded)
if (fileUploaded == null) return;

// Limit file size to 1MB
Expand All @@ -48,17 +49,18 @@ export default function MenuBar(props) {
return;
}

console.log('2', ! fileUploaded.name.endsWith('.xlsx')
|| !fileUploaded.name.endsWith('.json'))

// Check file extension
if (! fileUploaded.name.endsWith('.xlsx')
|| !fileUploaded.name.endsWith('.json')) {
if (fileUploaded.name.endsWith('.xlsx') || fileUploaded.name.endsWith('.json')) {
try {
uploaddb.mutate(fileUploaded);
} catch (error) {
emitError(`Failed uploading file: ${error}`)
}
} else {
emitError('Error: File type unknown')
return;
}

try {
uploaddb.mutate(fileUploaded);
} catch (error) {
emitError(`Failed uploading file: ${error}`)
}

// reset input value
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ontime",
"version": "0.5.0",
"version": "0.5.1",
"author": "Carlos Valente",
"description": "Time keeping for live events",
"repository": "https://github.com/cpvalente/ontime",
Expand Down

0 comments on commit c3f18fe

Please sign in to comment.