From 887bc00c56326a4826dcf80d8bd161354a397b25 Mon Sep 17 00:00:00 2001 From: halang Date: Tue, 22 Oct 2024 19:00:47 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=A0=EC=96=91=EC=9D=B4=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=EC=8B=9C=20=EB=A9=94=EC=84=B8=EC=A7=80=EA=B0=80=20?= =?UTF-8?q?=EB=9E=9C=EB=8D=A4=EC=9C=BC=EB=A1=9C=20=EB=82=98=EC=98=A4?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20(#58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/widgets/pomodoro/ui/home-screen.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/renderer/widgets/pomodoro/ui/home-screen.tsx b/src/renderer/widgets/pomodoro/ui/home-screen.tsx index a57916f..89af9cb 100644 --- a/src/renderer/widgets/pomodoro/ui/home-screen.tsx +++ b/src/renderer/widgets/pomodoro/ui/home-screen.tsx @@ -65,10 +65,14 @@ export const HomeScreen = ({ const [tooltipMessage, setTooltipMessage] = useState(''); useEffect(() => { + showRandomMessage(); + }, [user?.cat?.type]); + + const showRandomMessage = () => { const messages = getTooltipMessages(user?.cat?.type); const randomIndex = Math.floor(Math.random() * messages.length); setTooltipMessage(messages[randomIndex]); - }, [user?.cat?.type]); + }; return ( <> @@ -94,6 +98,7 @@ export const HomeScreen = ({ { + showRandomMessage(); clickCatInput?.fire(); }} />