Skip to content
Snippets Groups Projects
Commit 70f0826a authored by Ben Wheeler's avatar Ben Wheeler
Browse files

cleaned up vm cruft

parent 6974a986
No related branches found
No related tags found
No related merge requests found
...@@ -45,15 +45,10 @@ const FontLoaderHOC = function (WrappedComponent) { ...@@ -45,15 +45,10 @@ const FontLoaderHOC = function (WrappedComponent) {
} }
} }
render () { render () {
const {
/* eslint-disable no-unused-vars */
/* eslint-enable no-unused-vars */
...componentProps
} = this.props;
return ( return (
<WrappedComponent <WrappedComponent
fontsLoaded={this.state.fontsLoaded} fontsLoaded={this.state.fontsLoaded}
{...componentProps} {...this.props}
/> />
); );
} }
......
...@@ -5,10 +5,6 @@ import {connect} from 'react-redux'; ...@@ -5,10 +5,6 @@ import {connect} from 'react-redux';
import VM from 'scratch-vm'; import VM from 'scratch-vm';
import AudioEngine from 'scratch-audio'; import AudioEngine from 'scratch-audio';
import Renderer from 'scratch-render';
import VideoProvider from '../lib/video/video-provider';
import {SVGRenderer as V2SVGAdapter} from 'scratch-svg-renderer';
import {BitmapAdapter as V2BitmapAdapter} from 'scratch-svg-renderer';
import { import {
LoadingStates, LoadingStates,
...@@ -42,8 +38,8 @@ const vmManagerHOC = function (WrappedComponent) { ...@@ -42,8 +38,8 @@ const vmManagerHOC = function (WrappedComponent) {
this.props.vm.initialized = true; this.props.vm.initialized = true;
} }
componentDidUpdate (prevProps) { componentDidUpdate (prevProps) {
// if project state is LOADING variation, and fonts are loaded, // if project is in loading state, AND fonts are loaded,
// and that wasn't true until now, load project // and they weren't both that way until now... load project!
if (this.props.isLoadingWithId && this.props.fontsLoaded && if (this.props.isLoadingWithId && this.props.fontsLoaded &&
(!prevProps.isLoadingWithId || !prevProps.fontsLoaded)) { (!prevProps.isLoadingWithId || !prevProps.fontsLoaded)) {
this.loadProject(this.props.projectData, this.props.loadingState); this.loadProject(this.props.projectData, this.props.loadingState);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment