Skip to content

Commit 63347fc

Browse files
authored
Merge pull request #456 from RetiFier/valdate_json_upload
Add Validation JSON Upload Under Config options
2 parents 1c7bcb7 + 15c63a3 commit 63347fc

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
@@ -412,10 +412,12 @@ const IndexPage = () => {
412412

413413
const handleFileInput = e => {
414414
const file = e.target.files[0]
415-
const reader = new FileReader()
416-
reader.readAsText(file, "UTF-8")
417-
reader.onload = () => {
418-
setRestore(reader.result)
415+
if (file && file.type === "application/json") {
416+
const reader = new FileReader()
417+
reader.readAsText(file, "UTF-8")
418+
reader.onload = () => {
419+
setRestore(reader.result)
420+
}
419421
}
420422
}
421423

0 commit comments

Comments
 (0)