@@ -28,7 +28,7 @@ import LoginDropdown from './login-dropdown.jsx';
28
28
import SB3Downloader from '../../containers/sb3-downloader.jsx' ;
29
29
import DeletionRestorer from '../../containers/deletion-restorer.jsx' ;
30
30
import TurboMode from '../../containers/turbo-mode.jsx' ;
31
- import ConfirmReplaceHOC from './confirm-replace -hoc.jsx' ;
31
+ import MenuBarHOC from '../../containers/menu-bar -hoc.jsx' ;
32
32
33
33
import { openTipsLibrary } from '../../reducers/modals' ;
34
34
import { setPlayer } from '../../reducers/mode' ;
@@ -192,7 +192,7 @@ class MenuBar extends React.Component {
192
192
this . props . onRequestCloseFile ( ) ;
193
193
}
194
194
handleClickSeeCommunity ( waitForUpdate ) {
195
- if ( this . props . canSave && this . props . projectChanged ) { // save before transitioning to project page
195
+ if ( this . props . shouldSaveBeforeTransition ( ) ) { // save before transitioning to project page
196
196
this . props . autoUpdateProject ( ) ;
197
197
waitForUpdate ( true ) ; // queue the transition to project page
198
198
} else {
@@ -705,6 +705,7 @@ MenuBar.propTypes = {
705
705
canSave : PropTypes . bool ,
706
706
canShare : PropTypes . bool ,
707
707
className : PropTypes . string ,
708
+ confirmReadyToReplaceProject : PropTypes . func ,
708
709
editMenuOpen : PropTypes . bool ,
709
710
enableCommunity : PropTypes . bool ,
710
711
fileMenuOpen : PropTypes . bool ,
@@ -741,6 +742,7 @@ MenuBar.propTypes = {
741
742
projectTitle : PropTypes . string ,
742
743
renderLogin : PropTypes . func ,
743
744
sessionExists : PropTypes . bool ,
745
+ shouldSaveBeforeTransition : PropTypes . func ,
744
746
showComingSoon : PropTypes . bool ,
745
747
username : PropTypes . string ,
746
748
vm : PropTypes . instanceOf ( VM ) . isRequired
@@ -794,7 +796,7 @@ const mapDispatchToProps = dispatch => ({
794
796
795
797
export default compose (
796
798
injectIntl ,
797
- ConfirmReplaceHOC ,
799
+ MenuBarHOC ,
798
800
connect (
799
801
mapStateToProps ,
800
802
mapDispatchToProps
0 commit comments