forked from XiaoMo/ChatGPT-Next-Web
fix: #2149 try to fix chat action button style
This commit is contained in:
parent
1dd75b63de
commit
bce74890dc
@ -294,8 +294,8 @@ function ChatAction(props: {
|
|||||||
const iconRef = useRef<HTMLDivElement>(null);
|
const iconRef = useRef<HTMLDivElement>(null);
|
||||||
const textRef = useRef<HTMLDivElement>(null);
|
const textRef = useRef<HTMLDivElement>(null);
|
||||||
const [width, setWidth] = useState({
|
const [width, setWidth] = useState({
|
||||||
full: 20,
|
full: 16,
|
||||||
icon: 20,
|
icon: 16,
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateWidth() {
|
function updateWidth() {
|
||||||
@ -310,7 +310,13 @@ function ChatAction(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTimeout(updateWidth, 100);
|
const onClick = () => setTimeout(updateWidth, 10);
|
||||||
|
onClick();
|
||||||
|
|
||||||
|
window.addEventListener("click", onClick);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("click", onClick);
|
||||||
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user