From bb49b188f531676175e2c97eabf4391a7ed90c20 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Fri, 16 Aug 2024 06:10:59 -0400 Subject: [PATCH] redraw if new quote == current quote --- src/components/Footer.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index a55c768..12d2e39 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -26,7 +26,12 @@ export default function Footer() { }, [mailState]) const drawNewQuote = () => { - setQuote(quoteArray[Math.floor(Math.random() * quoteArray.length)]); + const newQuote = quoteArray[Math.floor(Math.random() * quoteArray.length)] + + // redraw if this quote == current quote + if (newQuote !== quote) { + setQuote(newQuote); + } else drawNewQuote(); } return (