mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
bye.js fix (support new mesh)
I am using gundb 0.8.1 0.2019.331 and noticed not working bye method when programming web application on this version. Maybe this is happened because bye() access to outdated mesh structure.
This commit is contained in:
parent
6b1af72038
commit
f7d9089ba7
@ -5,8 +5,8 @@ Gun.on('opt', function(root){
|
||||
if(root.once){ return }
|
||||
root.on('in', function(msg){
|
||||
//Msg did not have a peer property saved before, so nothing ever went further
|
||||
if(!msg.mesh || !msg.BYE){ return this.to.next(msg) }
|
||||
var peer = msg.mesh.via;
|
||||
if(!msg._ || !msg.BYE){ return this.to.next(msg) }
|
||||
var peer = msg._.via;
|
||||
(peer.bye = peer.bye || []).push(msg.BYE);
|
||||
})
|
||||
root.on('bye', function(peer){
|
||||
|
Loading…
x
Reference in New Issue
Block a user