Skip to content

Commit 91e2fc9

Browse files
committed
on showing project without id, tell owner of GUI to set title to default
1 parent 5fed732 commit 91e2fc9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/gui/gui.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ GUIComponent.defaultProps = {
433433
isCreating: false,
434434
isShared: false,
435435
loading: false,
436-
onUpdateProjectTitle: () => {},
437436
showComingSoon: false,
438437
stageSizeMode: STAGE_SIZE_MODES.large
439438
};

src/containers/gui.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {defineMessages, injectIntl, intlShape} from 'react-intl';
99
import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx';
1010
import {
1111
getIsError,
12-
getIsShowingProject
12+
getIsShowingProject,
13+
getIsShowingWithoutId
1314
} from '../reducers/project-state';
1415
import {setProjectTitle} from '../reducers/project-title';
1516
import {
@@ -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

Comments
 (0)