Commit efccc3fe authored by Bryce Johnson's avatar Bryce Johnson

Reset interval on visibility change.

parent 4743f77e
...@@ -54,11 +54,6 @@ ...@@ -54,11 +54,6 @@
this.stopTimer(); this.stopTimer();
} }
// cancel the existing timer, without resetting the currentInterval
pause() {
this.stopTimer();
}
// start a timer, using the existing interval // start a timer, using the existing interval
resume() { resume() {
this.stopTimer(); // stop exsiting timer, in case timer was not previously stopped this.stopTimer(); // stop exsiting timer, in case timer was not previously stopped
...@@ -100,7 +95,7 @@ ...@@ -100,7 +95,7 @@
handleVisibilityChange() { handleVisibilityChange() {
const state = this.state; const state = this.state;
const intervalAction = state.pageVisibility === 'hidden' ? this.pause : this.resume; const intervalAction = state.pageVisibility === 'hidden' ? this.cancel : this.resume;
intervalAction.apply(this); intervalAction.apply(this);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment