mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
fix opening sketches
from - on drop - index.js
This commit is contained in:
parent
63b33c69b9
commit
6b6b860c4a
4
index.js
4
index.js
@ -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
|
||||
|
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user