diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index 3c68eec90bf6d96b467f5bc18cf5790b0cce350e..ab7ec87b0e68c94d1d2dfd7a7b282f379da41782 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -433,7 +433,6 @@ GUIComponent.defaultProps = { isCreating: false, isShared: false, loading: false, - onUpdateProjectTitle: () => {}, showComingSoon: false, stageSizeMode: STAGE_SIZE_MODES.large }; diff --git a/src/containers/gui.jsx b/src/containers/gui.jsx index 2012c61e555cf8bf4a13160c430db09fea320e34..d2a47b41219757136a75149608a492badf96e540 100644 --- a/src/containers/gui.jsx +++ b/src/containers/gui.jsx @@ -9,7 +9,8 @@ import {defineMessages, injectIntl, intlShape} from 'react-intl'; import ErrorBoundaryHOC from '../lib/error-boundary-hoc.jsx'; import { getIsError, - getIsShowingProject + getIsShowingProject, + getIsShowingWithoutId } from '../reducers/project-state'; import {setProjectTitle} from '../reducers/project-title'; import { @@ -66,6 +67,9 @@ class GUI extends React.Component { // At this time the project view in www doesn't need to know when a project is unloaded this.props.onProjectLoaded(); } + if (this.props.isShowingWithoutId && !prevProps.isShowingWithoutId) { + this.props.onUpdateProjectTitle(this.props.intl.formatMessage(messages.defaultProjectTitle)); + } } setReduxTitle (newTitle) { if (newTitle === null || typeof newTitle === 'undefined') { @@ -126,6 +130,7 @@ GUI.propTypes = { isLoading: PropTypes.bool, isScratchDesktop: PropTypes.bool, isShowingProject: PropTypes.bool, + isShowingWithoutId: PropTypes.bool, loadingStateVisible: PropTypes.bool, onProjectLoaded: PropTypes.func, onSeeCommunity: PropTypes.func, @@ -146,6 +151,7 @@ GUI.defaultProps = { onStorageInit: storageInstance => storageInstance.addOfficialScratchWebStores(), onProjectLoaded: () => {}, onUpdateProjectId: () => {}, + onUpdateProjectTitle: () => {}, onVmInit: (/* vm */) => {} }; @@ -166,6 +172,7 @@ const mapStateToProps = state => { isPlayerOnly: state.scratchGui.mode.isPlayerOnly, isRtl: state.locales.isRtl, isShowingProject: getIsShowingProject(loadingState), + isShowingWithoutId: getIsShowingWithoutId(loadingState), loadingStateVisible: state.scratchGui.modals.loadingProject, projectId: state.scratchGui.projectState.projectId, soundsTabVisible: state.scratchGui.editorTab.activeTabIndex === SOUNDS_TAB_INDEX,