mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Merge pull request #2379 from paulkaplan/refresh-project-data
Refresh the data related to the project json on switch back from editor
This commit is contained in:
commit
4a57d36112
1 changed files with 5 additions and 0 deletions
|
@ -126,6 +126,11 @@ class Preview extends React.Component {
|
||||||
if (this.props.playerMode !== prevProps.playerMode || this.props.fullScreen !== prevProps.fullScreen) {
|
if (this.props.playerMode !== prevProps.playerMode || this.props.fullScreen !== prevProps.fullScreen) {
|
||||||
this.pushHistory(history.state === null);
|
this.pushHistory(history.state === null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Switching out of editor mode, refresh data that comes from project json
|
||||||
|
if (this.props.playerMode && !prevProps.playerMode) {
|
||||||
|
this.getProjectData(this.state.projectId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
this.removeEventListeners();
|
this.removeEventListeners();
|
||||||
|
|
Loading…
Reference in a new issue