diff --git a/frontend/src/components/ChatDock.tsx b/frontend/src/components/ChatDock.tsx index 12fff57..87dbb0d 100644 --- a/frontend/src/components/ChatDock.tsx +++ b/frontend/src/components/ChatDock.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useQueryClient } from "@tanstack/react-query"; import { ChevronDown, ChevronUp, X } from "lucide-react"; @@ -51,22 +51,12 @@ export default function ChatDock({ meId }: { meId: number }) { function ChatWindow({ chat, meId }: { chat: DockChat; meId: number }) { const { t } = useTranslation(); - const [flashing, setFlashing] = useState(false); - - // One-shot attention flash whenever a new message bumps the counter. - useEffect(() => { - if (chat.flash <= 0) return; - setFlashing(true); - const id = setTimeout(() => setFlashing(false), 800); - return () => clearTimeout(id); - }, [chat.flash]); - return ( -
+
+ {/* One-shot attention flash on a new message; keyed by the counter so it replays each time. */} + {chat.flash > 0 && ( +
+ )}