Skip to content

Commit affe124

Browse files
committed
Sync projects in compatibility tester
1 parent 058476c commit affe124

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/examples/compatibility-testing.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,22 @@ const mapStateToProps = state => ({vm: state.vm});
1414
const VMStage = connect(mapStateToProps)(Stage);
1515
const VMControls = connect(mapStateToProps)(Controls);
1616

17+
const DEFAULT_PROJECT_ID = '10015059';
18+
1719
class Player extends React.Component {
1820
constructor (props) {
1921
super(props);
2022
this.updateProject = this.updateProject.bind(this);
23+
2124
this.state = {
22-
projectId: window.location.hash.substring(1) || '10015059'
25+
projectId: window.location.hash.substring(1) || DEFAULT_PROJECT_ID
2326
};
2427
}
2528
componentDidMount () {
2629
window.addEventListener('hashchange', this.updateProject);
30+
if (!window.location.hash.substring(1)) {
31+
window.location.hash = DEFAULT_PROJECT_ID;
32+
}
2733
}
2834
componentWillUnmount () {
2935
window.addEventListener('hashchange', this.updateProject);

0 commit comments

Comments
 (0)