mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
de-dup helpers.cloudData
This commit is contained in:
parent
b2b00ee867
commit
ed1cf35721
1 changed files with 3 additions and 2 deletions
|
@ -276,7 +276,8 @@ class Preview extends React.Component {
|
||||||
newState.extensions = Array.from(helpers.extensions(projectData[0]));
|
newState.extensions = Array.from(helpers.extensions(projectData[0]));
|
||||||
newState.modInfo.scriptCount = helpers.scriptCount(projectData[0]);
|
newState.modInfo.scriptCount = helpers.scriptCount(projectData[0]);
|
||||||
newState.modInfo.spriteCount = helpers.spriteCount(projectData[0]);
|
newState.modInfo.spriteCount = helpers.spriteCount(projectData[0]);
|
||||||
if (helpers.cloudData(projectData[0])) {
|
const hasCloudData = helpers.cloudData(projectData[0]);
|
||||||
|
if (hasCloudData) {
|
||||||
if (this.props.isLoggedIn) {
|
if (this.props.isLoggedIn) {
|
||||||
// show cloud variables log link if logged in
|
// show cloud variables log link if logged in
|
||||||
newState.extensions.push({
|
newState.extensions.push({
|
||||||
|
@ -301,7 +302,7 @@ class Preview extends React.Component {
|
||||||
if (this.props.isLoggedIn) {
|
if (this.props.isLoggedIn) {
|
||||||
newState.showUsernameBlockAlert = helpers.usernameBlock(projectData[0]);
|
newState.showUsernameBlockAlert = helpers.usernameBlock(projectData[0]);
|
||||||
} else { // Check for cloud vars only if user is logged out
|
} else { // Check for cloud vars only if user is logged out
|
||||||
newState.showCloudDataAlert = helpers.cloudData(projectData[0]);
|
newState.showCloudDataAlert = hasCloudData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setState(newState);
|
this.setState(newState);
|
||||||
|
|
Loading…
Reference in a new issue