diff --git a/src/ui/MessagesView/MessagesView.jsx b/src/ui/MessagesView/MessagesView.jsx index 2235b3b..3bdad6b 100644 --- a/src/ui/MessagesView/MessagesView.jsx +++ b/src/ui/MessagesView/MessagesView.jsx @@ -48,7 +48,7 @@ const MessagesView = () => { send: 0, // the unit is bytes/s receive: 0, }); - const [latency, setLatency] = useState(); + const [latency, setLatency] = useState(null); const [isCompact, setIsCompact] = useState(false); const timer = useRef(null); diff --git a/src/ui/MessagesView/NetLatencyView.jsx b/src/ui/MessagesView/NetLatencyView.jsx index b16cf0c..f6d4a6f 100644 --- a/src/ui/MessagesView/NetLatencyView.jsx +++ b/src/ui/MessagesView/NetLatencyView.jsx @@ -4,7 +4,7 @@ import './NetLatencyView.scss'; const NetLatencyView = ({ capturing, latency }) => { if (!capturing) return null; - if (!latency) { + if (latency === null) { latency = '-ยท-'; } else if (latency > 999) { latency = '999+';