snapdrop
snapdrop copied to clipboard
no receiver unsupport notify
if receiver do not support WebRTC when sender sent messge or file, no notify here.
in browser's console show errors like:
Uncaught TypeError: this.peers[message.to].sendText is not a function
Uncaught TypeError: this.peers[message.to].sendFiles is not a function
TypeError: Cannot read properties of undefined (reading 'sendText')
TypeError: Cannot read properties of undefined (reading 'sendFiles ')
maybe we can catch exception where sending message or file like this: /client/scripts/network.js
_onFilesSelected(message) {
try {
this.peers[message.to].sendFiles(message.files);
} catch(err) {
alert("receiver may not support"); // or do something
}
}
_onSendText(message) {
try {
this.peers[message.to].sendText(message.text);
} catch(err) {
alert("receiver may not support"); // or do something
}
}