src/WebRTC.js
function () {
        // check if the clients still exists
        var peer = self.swr.webrtc.getPeers(uid)[0]
        var success
        if (peer) {
          // success is true, if the message is successfully sent
          success = peer.sendDirectly('simplewebrtc', 'yjs', message)
        }
        if (!success) {
          // resend the message if it didn't work
          setTimeout(send, 500)
        }
      }
function () {
        // check if the clients still exists
        var peer = self.swr.webrtc.getPeers(uid)[0]
        var success
        if (peer) {
          // success is true, if the message is successfully sent
          success = peer.sendDirectly('simplewebrtc', 'yjs', message)
        }
        if (!success) {
          // resend the message if it didn't work
          setTimeout(send, 500)
        }
      }
function ( ) { // check if the clients still exists var peer = self . swr . webrtc . getPeers ( uid ) [ 0 ] var success if ( peer ) { // success is true, if the message is successfully sent success = peer . sendDirectly ( 'simplewebrtc' , 'yjs' , message ) } if ( ! success ) { // resend the message if it didn't work setTimeout ( send , 500 ) } }
we have to make sure that the message is sent under all circumstances
we have to make sure that the message is sent under all circumstances