Merge pull request #2232 from benjiwheeler/dont-get-extensions

moved getExtensions out of constructor, and out of projectInfo response
This commit is contained in:
Benjamin Wheeler 2018-10-25 15:56:39 -04:00 committed by GitHub
commit 8653e358b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {