wait for assets to be loaded in create scene data

This commit is contained in:
Casper Lamboo 2018-04-23 10:26:49 +02:00
parent 24abade4b9
commit 0a3686d8df
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -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: {}