client + server + host fixes
[henge/kiak.git] / client.js
index 5607fa7..69ac81e 100644 (file)
--- a/client.js
+++ b/client.js
@@ -4,11 +4,6 @@ document.title = "Strapp.io Client"
 body.appendChild(root)
 document.body = body
 
-/*************/
-/* UNTESTED */
-/************
-
-
 /* Poll the server. Send get request, wait for timeout, send another request.
    Do this until...? Can be used for either reconnecting or waiting for answer*/
 function pollServerTimeout(url, data, resolve, reject) {
@@ -37,7 +32,8 @@ function pollServer(url, clientPubKey, func) {
     func(url, clientPubKey, resolve, reject )
   })
 }
-/* If https connection, should be already defined. If not https,*/
+
+/* TODO: duplicate in both client.js and host.js */
 function getPublicKey() {
   /* Check local storage for public key */
   if (window.localStorage.getItem('public-key') === undefined) {
@@ -70,8 +66,7 @@ cpc.createOffer().then((offer) => {
   /* Poll for answer */
   return pollServer(window.location, offer, pollServerTimeout)
 }).then((answer) => {
-  /* TODO: Extract sdp from answer ?*/
   console.log(answer)
-  /* State machine to parse answer */
+  /* TODO: State machine to parse answer */
   cpc.setRemoteDescription(answer.sdp)
 })