summaryrefslogtreecommitdiff
path: root/frontend/site/projects/museum/views/petros.text.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/site/projects/museum/views/petros.text.js')
-rw-r--r--frontend/site/projects/museum/views/petros.text.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/site/projects/museum/views/petros.text.js b/frontend/site/projects/museum/views/petros.text.js
index 96f5565..e28eb7a 100644
--- a/frontend/site/projects/museum/views/petros.text.js
+++ b/frontend/site/projects/museum/views/petros.text.js
@@ -4,17 +4,17 @@
import React, { Component } from 'react'
-export class PetrosText extends Component {
+export default class PetrosText extends Component {
constructor(props) {
super(props)
- this.state = { index: 0, words: [] }
+ this.state = { index: -1, words: [] }
this.next = this.next.bind(this)
}
componentDidUpdate(prevProps) {
if (this.props.ready && !prevProps.ready) {
this.start()
- } else {
+ } else if (!this.props.ready) {
clearTimeout(this.timeout)
}
}
@@ -24,13 +24,13 @@ export class PetrosText extends Component {
}
start() {
- const { perWord, text } = this.props
+ const { timePerWord, text } = this.props
this.setState({
words: this.props.text.trim().split(" "),
index: -1
})
clearTimeout(this.timeout)
- this.timeout = setTimeout(this.next, perWord)
+ this.timeout = setTimeout(this.next, timePerWord)
}
next() {