Merge pull request #456 from RetiFier/valdate_json_upload

Add Validation JSON Upload Under Config options
This commit is contained in:
Rahul Jain
2021-10-21 08:46:58 +05:30
committed by GitHub
+6 -4
View File
@@ -412,10 +412,12 @@ const IndexPage = () => {
const handleFileInput = e => {
const file = e.target.files[0]
const reader = new FileReader()
reader.readAsText(file, "UTF-8")
reader.onload = () => {
setRestore(reader.result)
if (file && file.type === "application/json") {
const reader = new FileReader()
reader.readAsText(file, "UTF-8")
reader.onload = () => {
setRestore(reader.result)
}
}
}