处理bug

This commit is contained in:
truewhile
2026-09-11 15:35:02 +08:00
parent 2bb3610da7
commit e840cbd2c9
20 changed files with 135 additions and 105 deletions
+4 -1
View File
@@ -15,7 +15,10 @@ export function useWebSocket(onEvent: (topic: string, payload: unknown) => void)
const ref = useRef<WebSocket | null>(null)
const token = useAuthStore((s) => s.token)
const onEventRef = useRef(onEvent)
onEventRef.current = onEvent
useEffect(() => {
onEventRef.current = onEvent
}, [onEvent])
useEffect(() => {
if (!token) return