fix opening sketches

from
- on drop
- index.js
This commit is contained in:
Casper Lamboo 2018-02-21 12:29:33 +01:00
parent 63b33c69b9
commit 6b6b860c4a
2 changed files with 5 additions and 5 deletions

View File

@ -55,8 +55,8 @@ window.downloadSketch = () => {
// add model to store
import modelData from './models/circle_error.d3sketch';
import JSONToSketchData from './src/shape/JSONToSketchData.js';
JSONToSketchData(JSON.parse(modelData)).then(sketch => {
store.dispatch(actions.openSketch(sketch));
JSONToSketchData(JSON.parse(modelData)).then(data => {
store.dispatch(actions.openSketch({ data }));
});
// default css

View File

@ -106,9 +106,9 @@ class App extends React.Component {
case 'D3SKETCH':
case 'JSON':
const url = URL.createObjectURL(file);
const data = await fetch(url).then(result => result.json());
const sketchData = await JSONToSketchData(data);
openSketch(sketchData);
const json = await fetch(url).then(result => result.json());
const data = await JSONToSketchData(json);
openSketch({ data });
break;
case 'JPG':
case 'JPEG':