Skip to content

Commit

Permalink
removed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim de Beer committed Aug 25, 2016
1 parent 9d841f2 commit 927a879
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions lib/client/send.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,17 @@ function send (client, stamp, id) {
}
const hub = client.root
if (client.val !== null) {
console.log(hub.id, client.id.compute(), hub.connected && hub.connected.compute() === true)
if (
// remove id
hub.id != client.id.compute() || // eslint-disable-line
hub.connected && hub.connected.compute() === true
) {
console.log('lets send it????', hub.id, client.id, hub.connected && hub.connected.compute() === true)
// why are you connected here???
socketSend(client, inprogress, id)
delete inprogress[id]
} else {
// need to scope is to one instance... now this is prop broken
// 100000x test with context
hub.connected.is(true, () => {
console.log('connected yo yo yo', client)
socketSend(client, inprogress, id)
delete inprogress[id]
})
Expand All @@ -70,15 +68,12 @@ function send (client, stamp, id) {
}

function socketSend (client, inprogress, id) {
console.log('yo send', id, client, inprogress, (new Error()).stack)
// need to check for connected this is an upstream
if (client.val === null) {
return
}
const payload = { state: inprogress[id] }
if (inprogress[id].client) {
payload.client = inprogress[id].client
delete inprogress[id].client
if (client.val !== null) {
const payload = { state: inprogress[id] }
if (inprogress[id].client) {
payload.client = inprogress[id].client
delete inprogress[id].client
}
client.socket.send(JSON.stringify(payload))
}
client.socket.send(JSON.stringify(payload))
}

0 comments on commit 927a879

Please sign in to comment.