Skip to content

Commit

Permalink
reset fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antonjanrutten committed May 20, 2017
1 parent 9426468 commit 847e74f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
11 changes: 8 additions & 3 deletions components/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,23 @@ export default class VRTextReader extends React.Component {
}

_start() {
if (this.state.intervalId !== 0) this.setState({ start: true });
const intervalId = setInterval(this._timer, 200);
this.setState({ intervalId: intervalId, start: true });
}

_pauze() {
if (this.state.intervalId !== 0) clearInterval(this.state.intervalId);
this.setState({ start: false, intervalId: 0 });
this.setState({ start: false });
}

_reset() {
if (this.state.intervalId !== 0) clearInterval(this.state.intervalId);
this.setState({ start: false, currentCount: 0, intervalId: 0 });
if (this.state.intervalId !== 0)
clearInterval(this.state.intervalId);
this.setState({
start: false, currentCount: 0, intervalId: 0, leftPartOfWord: '',
rightPartOfWord: '',
highlightedLetter: '' });
}

_timer() {
Expand Down

0 comments on commit 847e74f

Please sign in to comment.