Fix WS error when switching from settings to traffic viewer (#985)

This commit is contained in:
lirazyehezkel
2022-04-11 14:21:31 +03:00
committed by GitHub
parent bbb44dae79
commit 4bc83ebcb5

View File

@@ -201,7 +201,9 @@ export const TrafficViewer: React.FC<TrafficViewerProps> = ({
useEffect(() => {
return () => {
if (ws?.current?.readyState === WebSocket.OPEN) {
ws.current.close();
}
};
}, []);