Skip to content

Commit 6b6b860

Browse files
committed
fix opening sketches
from - on drop - index.js
1 parent 63b33c6 commit 6b6b860

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ window.downloadSketch = () => {
5555
// add model to store
5656
import modelData from './models/circle_error.d3sketch';
5757
import JSONToSketchData from './src/shape/JSONToSketchData.js';
58-
JSONToSketchData(JSON.parse(modelData)).then(sketch => {
59-
store.dispatch(actions.openSketch(sketch));
58+
JSONToSketchData(JSON.parse(modelData)).then(data => {
59+
store.dispatch(actions.openSketch({ data }));
6060
});
6161

6262
// default css

src/components/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class App extends React.Component {
106106
case 'D3SKETCH':
107107
case 'JSON':
108108
const url = URL.createObjectURL(file);
109-
const data = await fetch(url).then(result => result.json());
110-
const sketchData = await JSONToSketchData(data);
111-
openSketch(sketchData);
109+
const json = await fetch(url).then(result => result.json());
110+
const data = await JSONToSketchData(json);
111+
openSketch({ data });
112112
break;
113113
case 'JPG':
114114
case 'JPEG':

0 commit comments

Comments
 (0)