diff options
-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. |