Skip to content

Commit

Permalink
Merge pull request #2174 from Yidadaa/bugfix-0627
Browse files Browse the repository at this point in the history
fix: #2149 try to fix chat action button style
  • Loading branch information
Yidadaa authored Jun 27, 2023
2 parents eb93a43 + bce7489 commit efbd1c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ function ChatAction(props: {
const iconRef = useRef<HTMLDivElement>(null);
const textRef = useRef<HTMLDivElement>(null);
const [width, setWidth] = useState({
full: 20,
icon: 20,
full: 16,
icon: 16,
});

function updateWidth() {
Expand All @@ -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 (
Expand Down

0 comments on commit efbd1c1

Please sign in to comment.