From affe124db295f2a9013ccd7736d35f152ce27dac Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 3 Nov 2017 17:03:50 -0400 Subject: [PATCH] Sync projects in compatibility tester --- src/examples/compatibility-testing.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/examples/compatibility-testing.jsx b/src/examples/compatibility-testing.jsx index 11c9bc4bf..3fa8e71d9 100644 --- a/src/examples/compatibility-testing.jsx +++ b/src/examples/compatibility-testing.jsx @@ -14,16 +14,22 @@ const mapStateToProps = state => ({vm: state.vm}); const VMStage = connect(mapStateToProps)(Stage); const VMControls = connect(mapStateToProps)(Controls); +const DEFAULT_PROJECT_ID = '10015059'; + class Player extends React.Component { constructor (props) { super(props); this.updateProject = this.updateProject.bind(this); + this.state = { - projectId: window.location.hash.substring(1) || '10015059' + projectId: window.location.hash.substring(1) || DEFAULT_PROJECT_ID }; } componentDidMount () { window.addEventListener('hashchange', this.updateProject); + if (!window.location.hash.substring(1)) { + window.location.hash = DEFAULT_PROJECT_ID; + } } componentWillUnmount () { window.addEventListener('hashchange', this.updateProject);