mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 19:13:49 +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
|
// add model to store
|
||||||
import modelData from './models/circle_error.d3sketch';
|
import modelData from './models/circle_error.d3sketch';
|
||||||
import JSONToSketchData from './src/shape/JSONToSketchData.js';
|
import JSONToSketchData from './src/shape/JSONToSketchData.js';
|
||||||
JSONToSketchData(JSON.parse(modelData)).then(sketch => {
|
JSONToSketchData(JSON.parse(modelData)).then(data => {
|
||||||
store.dispatch(actions.openSketch(sketch));
|
store.dispatch(actions.openSketch({ data }));
|
||||||
});
|
});
|
||||||
|
|
||||||
// default css
|
// default css
|
||||||
|
@ -106,9 +106,9 @@ class App extends React.Component {
|
|||||||
case 'D3SKETCH':
|
case 'D3SKETCH':
|
||||||
case 'JSON':
|
case 'JSON':
|
||||||
const url = URL.createObjectURL(file);
|
const url = URL.createObjectURL(file);
|
||||||
const data = await fetch(url).then(result => result.json());
|
const json = await fetch(url).then(result => result.json());
|
||||||
const sketchData = await JSONToSketchData(data);
|
const data = await JSONToSketchData(json);
|
||||||
openSketch(sketchData);
|
openSketch({ data });
|
||||||
break;
|
break;
|
||||||
case 'JPG':
|
case 'JPG':
|
||||||
case 'JPEG':
|
case 'JPEG':
|
||||||
|
Loading…
Reference in New Issue
Block a user