Skip to content

Commit 15c63a3

Browse files
committed
Add Validation JSON Upload Under Config options
1 parent 0194c38 commit 15c63a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/pages/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ const IndexPage = () => {
410410

411411
const handleFileInput = e => {
412412
const file = e.target.files[0]
413-
const reader = new FileReader()
414-
reader.readAsText(file, "UTF-8")
415-
reader.onload = () => {
416-
setRestore(reader.result)
413+
if (file && file.type === "application/json") {
414+
const reader = new FileReader()
415+
reader.readAsText(file, "UTF-8")
416+
reader.onload = () => {
417+
setRestore(reader.result)
418+
}
417419
}
418420
}
419421

0 commit comments

Comments
 (0)