移除错误消息

This commit is contained in:
2023-10-21 08:34:26 +08:00
parent 346adfe6b6
commit 9b0d418abc
1 changed files with 17 additions and 12 deletions

View File

@ -95,18 +95,18 @@ export default class ClientList {
option.onmessage(event, client)
}
}
channel.onclose = event => {
console.debug('对方关闭', channel.label, '数据通道')
if (option && option.onclose) {
option.onclose(event, client)
}
}
channel.onerror = event => {
console.error(data.name, '通道', channel.label, '发生错误')
if (option && option.onerror) {
option.onerror(event, client)
}
}
//channel.onclose = event => {
// console.debug('对方关闭', channel.label, '数据通道')
// if (option && option.onclose) {
// option.onclose(event, client)
// }
//}
//channel.onerror = event => {
// console.error(data.name, '通道', channel.label, '发生错误')
// if (option && option.onerror) {
// option.onerror(event, client)
// }
//}
}
webrtc.onicecandidate = event => {
if (event.candidate) {
@ -136,6 +136,11 @@ export default class ClientList {
})
return dc
})
//// 页面刷新前主动关闭所有数据通道并关闭 WebRTC 连接
//window.addEventListener('beforeunload', event => {
// channels.forEach(ch => ch.close())
// webrtc.close()
//})
return { webrtc, channels }
}
if (data.type === 'list') {