@@ -60,9 +60,9 @@ const vmListenerHOC = function (WrappedComponent) {
60
60
this . props . vm . postIOData ( 'userData' , { username : this . props . username } ) ;
61
61
}
62
62
63
- // Re-request a targets update when the shouldEmitUpdate state changes to true
63
+ // Re-request a targets update when the shouldUpdateTargets state changes to true
64
64
// i.e. when the editor transitions out of fullscreen/player only modes
65
- if ( this . props . shouldEmitUpdates && ! prevProps . shouldEmitUpdates ) {
65
+ if ( this . props . shouldUpdateTargets && ! prevProps . shouldUpdateTargets ) {
66
66
this . props . vm . emitTargetsUpdate ( false /* Emit the event, but do not trigger project change */ ) ;
67
67
}
68
68
}
@@ -74,12 +74,12 @@ const vmListenerHOC = function (WrappedComponent) {
74
74
}
75
75
}
76
76
handleProjectChanged ( ) {
77
- if ( this . props . shouldEmitUpdates && ! this . props . projectChanged ) {
77
+ if ( this . props . shouldUpdateProjectChanged && ! this . props . projectChanged ) {
78
78
this . props . onProjectChanged ( ) ;
79
79
}
80
80
}
81
81
handleTargetsUpdate ( data ) {
82
- if ( this . props . shouldEmitUpdates ) {
82
+ if ( this . props . shouldUpdateTargets ) {
83
83
this . props . onTargetsUpdate ( data ) ;
84
84
}
85
85
}
@@ -118,7 +118,8 @@ const vmListenerHOC = function (WrappedComponent) {
118
118
/* eslint-disable no-unused-vars */
119
119
attachKeyboardEvents,
120
120
projectChanged,
121
- shouldEmitUpdates,
121
+ shouldUpdateTargets,
122
+ shouldUpdateProjectChanged,
122
123
onBlockDragUpdate,
123
124
onGreenFlag,
124
125
onKeyDown,
@@ -158,7 +159,8 @@ const vmListenerHOC = function (WrappedComponent) {
158
159
onTurboModeOff : PropTypes . func . isRequired ,
159
160
onTurboModeOn : PropTypes . func . isRequired ,
160
161
projectChanged : PropTypes . bool ,
161
- shouldEmitUpdates : PropTypes . bool ,
162
+ shouldUpdateTargets : PropTypes . bool ,
163
+ shouldUpdateProjectChanged : PropTypes . bool ,
162
164
username : PropTypes . string ,
163
165
vm : PropTypes . instanceOf ( VM ) . isRequired
164
166
} ;
@@ -170,8 +172,10 @@ const vmListenerHOC = function (WrappedComponent) {
170
172
projectChanged : state . scratchGui . projectChanged ,
171
173
// Do not emit target or project updates in fullscreen or player only mode
172
174
// or when recording sounds (it leads to garbled recordings on low-power machines)
173
- shouldEmitUpdates : ! state . scratchGui . mode . isFullScreen && ! state . scratchGui . mode . isPlayerOnly &&
175
+ shouldUpdateTargets : ! state . scratchGui . mode . isFullScreen && ! state . scratchGui . mode . isPlayerOnly &&
174
176
! state . scratchGui . modals . soundRecorder ,
177
+ // Do not update the projectChanged state in fullscreen or player only mode
178
+ shouldUpdateProjectChanged : ! state . scratchGui . mode . isFullScreen && ! state . scratchGui . mode . isPlayerOnly ,
175
179
vm : state . scratchGui . vm ,
176
180
username : state . session && state . session . session && state . session . session . user ?
177
181
state . session . session . user . username : ''
0 commit comments