File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,22 @@ const mapStateToProps = state => ({vm: state.vm});
14
14
const VMStage = connect ( mapStateToProps ) ( Stage ) ;
15
15
const VMControls = connect ( mapStateToProps ) ( Controls ) ;
16
16
17
+ const DEFAULT_PROJECT_ID = '10015059' ;
18
+
17
19
class Player extends React . Component {
18
20
constructor ( props ) {
19
21
super ( props ) ;
20
22
this . updateProject = this . updateProject . bind ( this ) ;
23
+
21
24
this . state = {
22
- projectId : window . location . hash . substring ( 1 ) || '10015059'
25
+ projectId : window . location . hash . substring ( 1 ) || DEFAULT_PROJECT_ID
23
26
} ;
24
27
}
25
28
componentDidMount ( ) {
26
29
window . addEventListener ( 'hashchange' , this . updateProject ) ;
30
+ if ( ! window . location . hash . substring ( 1 ) ) {
31
+ window . location . hash = DEFAULT_PROJECT_ID ;
32
+ }
27
33
}
28
34
componentWillUnmount ( ) {
29
35
window . addEventListener ( 'hashchange' , this . updateProject ) ;
You can’t perform that action at this time.
0 commit comments