Browse Source

wait for assets to be loaded in create scene data

pull/6/head
Casper Lamboo 4 years ago
parent
commit
0a3686d8df
  1. 2
      src/components/DoodlePreview.js
  2. 5
      src/d3/createSceneData.js

2
src/components/DoodlePreview.js

@ -51,7 +51,7 @@ class DoodlePreview extends React.Component {
const { canvas } = this.refs;
const sceneData = createSceneData(sketchData);
const sceneData = await createSceneData(sketchData);
const scene = createScene(sceneData, canvas);
this.setState(scene);

5
src/d3/createSceneData.js vendored

@ -1,7 +1,10 @@
import shortid from 'shortid';
import { SHAPE_TYPE_PROPERTIES } from '../constants/shapeTypeProperties.js';
import { load } from '../utils/loaded.js';
export default async function createSceneData(docData) {
await load;
export default function docToShapeData(docData) {
const sketchData = {
spaces: {},
objectsById: {}

Loading…
Cancel
Save