mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-18 06:08:22 +03:00
The connect() function creates a WebSocket but never stores the reference. The useEffect cleanup only closes the RTCPeerConnection via pcRef, leaving the WebSocket open. Each time the component re-renders with changed deps (camera switch, playback toggle, microphone toggle), a new WebSocket is created without closing the previous one. This leaks connections until the browser garbage-collects them or the server times out. Store the WebSocket in a ref and close it in the cleanup function. |
||
|---|---|---|
| .. | ||
| api | ||
| components | ||
| context | ||
| hooks | ||
| lib | ||
| pages | ||
| types | ||
| utils | ||
| views | ||
| App.tsx | ||
| env.ts | ||
| index.css | ||
| login.tsx | ||
| main.tsx | ||
| vite-env.d.ts | ||