We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1c7bcb7 + 15c63a3 commit 63347fcCopy full SHA for 63347fc
1 file changed
src/pages/index.js
@@ -412,10 +412,12 @@ const IndexPage = () => {
412
413
const handleFileInput = e => {
414
const file = e.target.files[0]
415
- const reader = new FileReader()
416
- reader.readAsText(file, "UTF-8")
417
- reader.onload = () => {
418
- setRestore(reader.result)
+ if (file && file.type === "application/json") {
+ const reader = new FileReader()
+ reader.readAsText(file, "UTF-8")
+ reader.onload = () => {
419
+ setRestore(reader.result)
420
+ }
421
}
422
423
0 commit comments