@@ -74,7 +74,7 @@ const vmListenerHOC = function (WrappedComponent) {
74
74
}
75
75
}
76
76
handleProjectChanged ( ) {
77
- if ( this . props . shouldEmitUpdates ) {
77
+ if ( this . props . shouldEmitUpdates && ! this . props . projectChanged ) {
78
78
this . props . onProjectChanged ( ) ;
79
79
}
80
80
}
@@ -117,6 +117,7 @@ const vmListenerHOC = function (WrappedComponent) {
117
117
const {
118
118
/* eslint-disable no-unused-vars */
119
119
attachKeyboardEvents,
120
+ projectChanged,
120
121
shouldEmitUpdates,
121
122
onBlockDragUpdate,
122
123
onGreenFlag,
@@ -154,6 +155,7 @@ const vmListenerHOC = function (WrappedComponent) {
154
155
onTargetsUpdate : PropTypes . func . isRequired ,
155
156
onTurboModeOff : PropTypes . func . isRequired ,
156
157
onTurboModeOn : PropTypes . func . isRequired ,
158
+ projectChanged : PropTypes . bool ,
157
159
shouldEmitUpdates : PropTypes . bool ,
158
160
username : PropTypes . string ,
159
161
vm : PropTypes . instanceOf ( VM ) . isRequired
@@ -163,6 +165,7 @@ const vmListenerHOC = function (WrappedComponent) {
163
165
onGreenFlag : ( ) => ( { } )
164
166
} ;
165
167
const mapStateToProps = state => ( {
168
+ projectChanged : state . scratchGui . projectChanged ,
166
169
// Do not emit target or project updates in fullscreen or player only mode
167
170
// or when recording sounds (it leads to garbled recordings on low-power machines)
168
171
shouldEmitUpdates : ! state . scratchGui . mode . isFullScreen && ! state . scratchGui . mode . isPlayerOnly &&
0 commit comments