diff options
author | Renard | 2019-09-25 23:39:47 -0300 |
---|---|---|
committer | Renard | 2019-09-25 23:39:47 -0300 |
commit | c15d93c6d4b36bfac1dab6f2f76cd11c48edea19 (patch) | |
tree | 99e6507964365e8105d10007caea41dd8ee98c08 /src/ReplyForm.js | |
parent | 56f23fad45bab476efe6a74f207dfe78470f1b87 (diff) | |
download | bai-client-c15d93c6d4b36bfac1dab6f2f76cd11c48edea19.tar.gz bai-client-c15d93c6d4b36bfac1dab6f2f76cd11c48edea19.tar.xz bai-client-c15d93c6d4b36bfac1dab6f2f76cd11c48edea19.zip |
Fix: random quote
Diffstat (limited to 'src/ReplyForm.js')
-rw-r--r-- | src/ReplyForm.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ReplyForm.js b/src/ReplyForm.js index 0b01029..b00e73b 100644 --- a/src/ReplyForm.js +++ b/src/ReplyForm.js @@ -76,6 +76,8 @@ class ReplyForm extends Component { }) .then(resource => { if (resource.state === "success") { + this.randomQuote = + quotes[Math.floor(Math.random() * quotes.length)]; this.setState({ replyRes: resource, message: "" }); let ownPosts = JSON.parse(localStorage.getItem("ownPosts")); if (ownPosts === null) { @@ -118,7 +120,7 @@ class ReplyForm extends Component { replyRes.state === "success" ? ( <Message positive> <Message.Header>Gracias por tu post</Message.Header> - {quotes[Math.floor(Math.random() * quotes.length)]} + {this.randomQuote} <br /> <span className="ui small text"> Nos tomó {replyRes.time_taken} segundos procesar tu mensaje. |