mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 15:47:53 -05:00
Merge pull request #2232 from benjiwheeler/dont-get-extensions
moved getExtensions out of constructor, and out of projectInfo response
This commit is contained in:
commit
8653e358b1
1 changed files with 1 additions and 2 deletions
|
@ -80,7 +80,6 @@ class Preview extends React.Component {
|
||||||
addToStudioOpen: false,
|
addToStudioOpen: false,
|
||||||
reportOpen: false
|
reportOpen: false
|
||||||
};
|
};
|
||||||
this.getExtensions(this.state.projectId);
|
|
||||||
this.addEventListeners();
|
this.addEventListeners();
|
||||||
/* In the beginning, if user is on mobile and landscape, go to fullscreen */
|
/* In the beginning, if user is on mobile and landscape, go to fullscreen */
|
||||||
this.setScreenFromOrientation();
|
this.setScreenFromOrientation();
|
||||||
|
@ -91,12 +90,12 @@ class Preview extends React.Component {
|
||||||
this.props.sessionStatus === sessionActions.Status.FETCHED) ||
|
this.props.sessionStatus === sessionActions.Status.FETCHED) ||
|
||||||
(this.state.projectId !== prevState.projectId))) {
|
(this.state.projectId !== prevState.projectId))) {
|
||||||
this.fetchCommunityData();
|
this.fetchCommunityData();
|
||||||
|
this.getExtensions(this.state.projectId);
|
||||||
}
|
}
|
||||||
if (this.state.projectId === '0' && this.state.projectId !== prevState.projectId) {
|
if (this.state.projectId === '0' && this.state.projectId !== prevState.projectId) {
|
||||||
this.props.resetProject();
|
this.props.resetProject();
|
||||||
}
|
}
|
||||||
if (this.props.projectInfo.id !== prevProps.projectInfo.id) {
|
if (this.props.projectInfo.id !== prevProps.projectInfo.id) {
|
||||||
this.getExtensions(this.state.projectId);
|
|
||||||
if (typeof this.props.projectInfo.id === 'undefined') {
|
if (typeof this.props.projectInfo.id === 'undefined') {
|
||||||
this.initCounts(0, 0);
|
this.initCounts(0, 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue