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

simplified vm loading in vm-manager-hoc

parent de526cf4
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@ const vmManagerHOC = function (WrappedComponent) {
'loadProject'
]);
this.state = {
isStarted: false,
loadingError: false,
errorMessage: ''
};
......@@ -34,6 +33,8 @@ const vmManagerHOC = function (WrappedComponent) {
if (this.props.vm.initialized) return;
this.audioEngine = new AudioEngine();
this.props.vm.attachAudioEngine(this.audioEngine);
this.props.vm.setCompatibilityMode(true);
this.props.vm.start();
this.props.vm.initialized = true;
}
componentDidUpdate (prevProps) {
......@@ -44,11 +45,6 @@ const vmManagerHOC = function (WrappedComponent) {
loadProject (projectData, projectState) {
return this.props.vm.loadProject(projectData)
.then(() => {
if (!this.state.isStarted) {
this.props.vm.setCompatibilityMode(true);
this.props.vm.start();
this.setState({isStarted: true});
}
this.props.doneLoading(projectState);
})
.catch(e => {
......
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