summaryrefslogtreecommitdiff
path: root/public/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/lib')
-rw-r--r--public/js/lib/ws.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/public/js/lib/ws.js b/public/js/lib/ws.js
index 15af8a1..3d62ef0 100644
--- a/public/js/lib/ws.js
+++ b/public/js/lib/ws.js
@@ -1,11 +1,12 @@
var ws = (function(){
var ws = {}
- var socket, socketIsReady
+ var socket, ready
ws.connect = function (room) {
if (this.socket) return;
- var socketPath = window.location.origin + '/' + room
- ws.socket = socket = io(socketPath)
+ var path = window.location.origin + '/' + room
+
+ ws.socket = socket = io(path)
// this.socket.on('connect', function(){ console.log(new Date(), "connected")})
socket.on('ready', ws.ready)
socket.on('error', ws.error)
@@ -19,11 +20,11 @@ var ws = (function(){
console.log(new Date(), "ready")
// presumably we might have reconnected?
- if (socketIsReady) {
+ if (ready) {
// this.chatView.fetchAndDedupe()
}
else {
- socketIsReady = true
+ ready = true
// this.checkIfLoaded()
}
}