Skip to content

Commit

Permalink
Only activate the react delay in single-post mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Sothatsit committed Feb 12, 2024
1 parent 1774d39 commit c20a4b7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/screens/game/GameInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class GameScreen extends ActiveGameScreen {

error: null,

allowReactions: false,
allowReactions: true,
interactions: GamePostInteractionStore.empty(),
dismissedPrompt: false,

Expand Down Expand Up @@ -252,14 +252,17 @@ export class GameScreen extends ActiveGameScreen {
this.cancelReactDelay();
}

onPromptContinue() {
onPromptContinue(study) {
this.setState((prevState) => {
return {
...prevState,
dismissedPrompt: true
};
});
this.startReactDelay();

if (!study.uiSettings.displayPostsInFeed) {
this.startReactDelay();
}
}

onPostReaction(postIndex, reaction, study) {
Expand Down Expand Up @@ -378,6 +381,7 @@ export class GameScreen extends ActiveGameScreen {
this.changeTimeoutID = null;
}

const doStartReactDelay = !game.study.uiSettings.displayPostsInFeed;
if (followerChange || credibilityChange) {
this.changeTimeoutID = setTimeout(() => {
this.setStateIfMounted(() => {
Expand All @@ -386,10 +390,12 @@ export class GameScreen extends ActiveGameScreen {
credibilityChange: null
};
});
this.startReactDelay();
if (doStartReactDelay) {
this.startReactDelay();
}
}, 1500);

} else {
} else if (doStartReactDelay) {
this.startReactDelay();
}
}
Expand Down Expand Up @@ -610,7 +616,7 @@ export class GameScreen extends ActiveGameScreen {
{displayPrompt &&
<GamePrompt study={study} onClick={(enabled) => {
if (enabled) {
this.onPromptContinue();
this.onPromptContinue(study);
}
}} />}

Expand Down

0 comments on commit c20a4b7

Please sign in to comment.