From c15d93c6d4b36bfac1dab6f2f76cd11c48edea19 Mon Sep 17 00:00:00 2001 From: Renard Date: Wed, 25 Sep 2019 23:39:47 -0300 Subject: Fix: random quote --- src/ReplyForm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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" ? ( Gracias por tu post - {quotes[Math.floor(Math.random() * quotes.length)]} + {this.randomQuote}
Nos tomó {replyRes.time_taken} segundos procesar tu mensaje. -- cgit v1.2.1-18-gbd029