Skip to content
Snippets Groups Projects
Commit affe124d authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Sync projects in compatibility tester

parent 058476cb
No related branches found
No related tags found
No related merge requests found
...@@ -14,16 +14,22 @@ const mapStateToProps = state => ({vm: state.vm}); ...@@ -14,16 +14,22 @@ const mapStateToProps = state => ({vm: state.vm});
const VMStage = connect(mapStateToProps)(Stage); const VMStage = connect(mapStateToProps)(Stage);
const VMControls = connect(mapStateToProps)(Controls); const VMControls = connect(mapStateToProps)(Controls);
const DEFAULT_PROJECT_ID = '10015059';
class Player extends React.Component { class Player extends React.Component {
constructor (props) { constructor (props) {
super(props); super(props);
this.updateProject = this.updateProject.bind(this); this.updateProject = this.updateProject.bind(this);
this.state = { this.state = {
projectId: window.location.hash.substring(1) || '10015059' projectId: window.location.hash.substring(1) || DEFAULT_PROJECT_ID
}; };
} }
componentDidMount () { componentDidMount () {
window.addEventListener('hashchange', this.updateProject); window.addEventListener('hashchange', this.updateProject);
if (!window.location.hash.substring(1)) {
window.location.hash = DEFAULT_PROJECT_ID;
}
} }
componentWillUnmount () { componentWillUnmount () {
window.addEventListener('hashchange', this.updateProject); window.addEventListener('hashchange', this.updateProject);
......
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