Skip to content

Commit

Permalink
fix opening sketches
Browse files Browse the repository at this point in the history
from
- on drop
- index.js
  • Loading branch information
casperlamboo committed Feb 21, 2018
1 parent 63b33c6 commit 6b6b860
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 6b6b860

Please sign in to comment.