mirror of
https://github.com/langgenius/dify.git
synced 2025-11-30 21:06:48 +00:00
fix: debounce ref (#26433)
This commit is contained in:
parent
c43c72c1a3
commit
fd86cadf67
@ -160,8 +160,13 @@ const Chat: FC<ChatProps> = ({
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('resize', debounce(handleWindowResize))
|
||||
return () => window.removeEventListener('resize', handleWindowResize)
|
||||
const debouncedHandler = debounce(handleWindowResize, 200)
|
||||
window.addEventListener('resize', debouncedHandler)
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('resize', debouncedHandler)
|
||||
debouncedHandler.cancel()
|
||||
}
|
||||
}, [handleWindowResize])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user