mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
only process json files
This commit is contained in:
parent
293393996f
commit
9471759ef1
1 changed files with 3 additions and 3 deletions
|
@ -122,15 +122,15 @@ class EditICDialog extends React.Component {
|
|||
|
||||
selectStartParamsFile(event) {
|
||||
const file = event.target.files[0];
|
||||
if (file.type.match('application/json') === false) {
|
||||
console.log("not a json file")
|
||||
|
||||
if (!file.type.match('application/json')) {
|
||||
console.error("Not a json file. Will not process file '" + file.name + "'.")
|
||||
return;
|
||||
}
|
||||
|
||||
let reader = new FileReader();
|
||||
reader.readAsText(file);
|
||||
|
||||
// TODO: error handling
|
||||
reader.onload = event => {
|
||||
const params = JSON.parse(reader.result);
|
||||
this.setState({ startParameterSchema: params})
|
||||
|
|
Loading…
Add table
Reference in a new issue