mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
fix @d3x0r 's double close
This commit is contained in:
parent
7320c18248
commit
873afd8325
4
gun.js
4
gun.js
@ -2104,8 +2104,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user