Merge branch '0.5' of https://github.com/amark/gun into 0.5

This commit is contained in:
Mark Nadal
2016-10-02 09:59:47 -07:00

4
gun.js
View File

@@ -2205,8 +2205,8 @@
(ws = r.ws.peers[opt.base] = new WS(opt.base.replace('http','ws'))).cbs = {};
ws.onopen = function(o){ r.back = 2; r.ws(opt, cb) };
ws.onclose = window.onbeforeunload = function(c){
if(!c){ return }
if(ws && ws.close instanceof Function){ ws.close() }
if(!ws || !c){ return }
if(ws.close instanceof Function){ ws.close() }
if(!ws.sending){
ws = r.ws.peers[opt.base] = false;
return r.transport(opt, cb);