From bce74890dca87dbdab5f5171ecfb791a1f8c55be Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Wed, 28 Jun 2023 01:02:56 +0800 Subject: [PATCH] fix: #2149 try to fix chat action button style --- app/components/chat.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 32cab346c..d49a77e3d 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -294,8 +294,8 @@ function ChatAction(props: { const iconRef = useRef(null); const textRef = useRef(null); const [width, setWidth] = useState({ - full: 20, - icon: 20, + full: 16, + icon: 16, }); function updateWidth() { @@ -310,7 +310,13 @@ function ChatAction(props: { } useEffect(() => { - setTimeout(updateWidth, 100); + const onClick = () => setTimeout(updateWidth, 10); + onClick(); + + window.addEventListener("click", onClick); + return () => { + window.removeEventListener("click", onClick); + }; }, []); return (