mirror of https://github.com/jetkvm/kvm.git
fix: suppress expected datachannel closure errors during logout
This commit is contained in:
parent
f7a5ed6d2e
commit
e7bdabb667
|
|
@ -31,9 +31,16 @@ export default function InfoBar() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!rpcDataChannel) return;
|
if (!rpcDataChannel) return;
|
||||||
rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed");
|
rpcDataChannel.onclose = () => {
|
||||||
rpcDataChannel.onerror = (e: Event) =>
|
if (rpcDataChannel.readyState === "closed") {
|
||||||
console.error(`Error on DataChannel '${rpcDataChannel.label}': ${e}`);
|
console.debug("rpcDataChannel closed");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
rpcDataChannel.onerror = (e: Event) => {
|
||||||
|
if (rpcDataChannel.readyState === "open" || rpcDataChannel.readyState === "connecting") {
|
||||||
|
console.error(`Error on DataChannel '${rpcDataChannel.label}':`, e);
|
||||||
|
}
|
||||||
|
};
|
||||||
}, [rpcDataChannel]);
|
}, [rpcDataChannel]);
|
||||||
|
|
||||||
const { keyboardLedState, usbState } = useHidStore();
|
const { keyboardLedState, usbState } = useHidStore();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue