@@ -9,7 +9,8 @@ import {defineMessages, injectIntl, intlShape} from 'react-intl';
99import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx' ;
1010import {
1111 getIsError ,
12- getIsShowingProject
12+ getIsShowingProject ,
13+ getIsShowingWithoutId
1314} from '../reducers/project-state' ;
1415import { setProjectTitle } from '../reducers/project-title' ;
1516import {
@@ -66,6 +67,9 @@ class GUI extends React.Component {
6667 // At this time the project view in www doesn't need to know when a project is unloaded
6768 this . props . onProjectLoaded ( ) ;
6869 }
70+ if ( this . props . isShowingWithoutId && ! prevProps . isShowingWithoutId ) {
71+ this . props . onUpdateProjectTitle ( this . props . intl . formatMessage ( messages . defaultProjectTitle ) ) ;
72+ }
6973 }
7074 setReduxTitle ( newTitle ) {
7175 if ( newTitle === null || typeof newTitle === 'undefined' ) {
@@ -126,6 +130,7 @@ GUI.propTypes = {
126130 isLoading : PropTypes . bool ,
127131 isScratchDesktop : PropTypes . bool ,
128132 isShowingProject : PropTypes . bool ,
133+ isShowingWithoutId : PropTypes . bool ,
129134 loadingStateVisible : PropTypes . bool ,
130135 onProjectLoaded : PropTypes . func ,
131136 onSeeCommunity : PropTypes . func ,
@@ -146,6 +151,7 @@ GUI.defaultProps = {
146151 onStorageInit : storageInstance => storageInstance . addOfficialScratchWebStores ( ) ,
147152 onProjectLoaded : ( ) => { } ,
148153 onUpdateProjectId : ( ) => { } ,
154+ onUpdateProjectTitle : ( ) => { } ,
149155 onVmInit : ( /* vm */ ) => { }
150156} ;
151157
@@ -166,6 +172,7 @@ const mapStateToProps = state => {
166172 isPlayerOnly : state . scratchGui . mode . isPlayerOnly ,
167173 isRtl : state . locales . isRtl ,
168174 isShowingProject : getIsShowingProject ( loadingState ) ,
175+ isShowingWithoutId : getIsShowingWithoutId ( loadingState ) ,
169176 loadingStateVisible : state . scratchGui . modals . loadingProject ,
170177 projectId : state . scratchGui . projectState . projectId ,
171178 soundsTabVisible : state . scratchGui . editorTab . activeTabIndex === SOUNDS_TAB_INDEX ,
0 commit comments