mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Only track green flag once
This commit is contained in:
parent
e1780b2454
commit
a2fbdf9943
1 changed files with 7 additions and 3 deletions
|
@ -117,7 +117,8 @@ class Preview extends React.Component {
|
|||
showUsernameBlockAlert: false,
|
||||
projectId: parts[1] === 'editor' ? '0' : parts[1],
|
||||
reportOpen: false,
|
||||
singleCommentId: singleCommentId
|
||||
singleCommentId: singleCommentId,
|
||||
greenFlagRecorded: false
|
||||
};
|
||||
/* In the beginning, if user is on mobile and landscape, go to fullscreen */
|
||||
this.setScreenFromOrientation();
|
||||
|
@ -357,11 +358,14 @@ class Preview extends React.Component {
|
|||
this.props.reportProject(this.state.projectId, formData, this.props.user.token);
|
||||
}
|
||||
handleGreenFlag () {
|
||||
if (!this.state.greenFlagRecorded) {
|
||||
this.props.logProjectView(this.props.projectInfo.id, this.props.authorUsername, this.props.user.token);
|
||||
}
|
||||
this.setState({
|
||||
showUsernameBlockAlert: false,
|
||||
showCloudDataAlert: false
|
||||
showCloudDataAlert: false,
|
||||
greenFlagRecorded: true
|
||||
});
|
||||
this.props.logProjectView(this.props.projectInfo.id, this.props.authorUsername, this.props.user.token);
|
||||
}
|
||||
handlePopState () {
|
||||
const path = window.location.pathname.toLowerCase();
|
||||
|
|
Loading…
Reference in a new issue