Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

...some screens get skipped mysteriously #76

Closed
agnescameron opened this issue May 11, 2020 · 2 comments
Closed

...some screens get skipped mysteriously #76

agnescameron opened this issue May 11, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@agnescameron
Copy link
Collaborator

where do they go? who ate the screens? do they simply appear on someone else's computer? etc

@agnescameron agnescameron self-assigned this May 11, 2020
@agnescameron agnescameron added the bug Something isn't working label May 11, 2020
@agnescameron
Copy link
Collaborator Author

probably related to #75

@agnescameron
Copy link
Collaborator Author

this is now fixed.

The problem that was solved by #75 was that the timer wasn't clearing properly at the start of every round. So, if you took your time (for example) entering your name or starting a chat, the timer would already be 'over' by the time you went to the next screen. This got solved by making the setting of this.shouldUpdate only happen after the timer had been reset, using:

    this.setState({ timerStart: Date.now()},
      () => this.setState({ timerTime: 0},
      () => this.shouldUpdate = true))

...which worked really great, apart from:

now there were only 2 screens getting skipped, and only after the checkTimeout screens. What was happening was that, while the callback was happening, the loop had already looped around again and was getting called twice, effectively skipping a screen.

This is solved by just await-ing checkTimeout in configureState, which seems to work pretty well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant