@@ -9,7 +9,8 @@ import {defineMessages, injectIntl, intlShape} from 'react-intl';
9
9
import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx' ;
10
10
import {
11
11
getIsError ,
12
- getIsShowingProject
12
+ getIsShowingProject ,
13
+ getIsShowingWithoutId
13
14
} from '../reducers/project-state' ;
14
15
import { setProjectTitle } from '../reducers/project-title' ;
15
16
import {
@@ -66,6 +67,9 @@ class GUI extends React.Component {
66
67
// At this time the project view in www doesn't need to know when a project is unloaded
67
68
this . props . onProjectLoaded ( ) ;
68
69
}
70
+ if ( this . props . isShowingWithoutId && ! prevProps . isShowingWithoutId ) {
71
+ this . props . onUpdateProjectTitle ( this . props . intl . formatMessage ( messages . defaultProjectTitle ) ) ;
72
+ }
69
73
}
70
74
setReduxTitle ( newTitle ) {
71
75
if ( newTitle === null || typeof newTitle === 'undefined' ) {
@@ -126,6 +130,7 @@ GUI.propTypes = {
126
130
isLoading : PropTypes . bool ,
127
131
isScratchDesktop : PropTypes . bool ,
128
132
isShowingProject : PropTypes . bool ,
133
+ isShowingWithoutId : PropTypes . bool ,
129
134
loadingStateVisible : PropTypes . bool ,
130
135
onProjectLoaded : PropTypes . func ,
131
136
onSeeCommunity : PropTypes . func ,
@@ -146,6 +151,7 @@ GUI.defaultProps = {
146
151
onStorageInit : storageInstance => storageInstance . addOfficialScratchWebStores ( ) ,
147
152
onProjectLoaded : ( ) => { } ,
148
153
onUpdateProjectId : ( ) => { } ,
154
+ onUpdateProjectTitle : ( ) => { } ,
149
155
onVmInit : ( /* vm */ ) => { }
150
156
} ;
151
157
@@ -166,6 +172,7 @@ const mapStateToProps = state => {
166
172
isPlayerOnly : state . scratchGui . mode . isPlayerOnly ,
167
173
isRtl : state . locales . isRtl ,
168
174
isShowingProject : getIsShowingProject ( loadingState ) ,
175
+ isShowingWithoutId : getIsShowingWithoutId ( loadingState ) ,
169
176
loadingStateVisible : state . scratchGui . modals . loadingProject ,
170
177
projectId : state . scratchGui . projectState . projectId ,
171
178
soundsTabVisible : state . scratchGui . editorTab . activeTabIndex === SOUNDS_TAB_INDEX ,
0 commit comments