fix for @mmalmi 's Identifi

This commit is contained in:
Mark Nadal 2018-12-20 18:15:49 -08:00
parent 3d796b4014
commit c7333fab42
2 changed files with 10 additions and 11 deletions

17
gun.js
View File

@ -1385,7 +1385,7 @@
});
return gun;
}
as.$ = gun = root.get(as.soul);
as.$ = root.get(as.soul);
as.ref = as.$;
ify(as);
return gun;
@ -1540,8 +1540,8 @@
as.data = obj_put({}, at.get, as.data);
});
}
tmp = tmp || at.get;
at = (at.root.$.get(tmp)._);
tmp = tmp || at.soul || at.link || at.dub;// || at.get;
at = tmp? (at.root.$.get(tmp)._) : at;
as.soul = tmp;
data = as.data;
}
@ -1759,13 +1759,12 @@
var gun = this, soul;
cb = cb || function(){};
opt = opt || {}; opt.item = opt.item || item;
if(soul = Gun.node.soul(item)){ return gun.set(gun.back(-1).get(soul), cb, opt) }
if(soul = Gun.node.soul(item)){ item = Gun.obj.put({}, soul, Gun.val.link.ify(soul)) }
if(!Gun.is(item)){
var id = gun.back('opt.uuid')();
if(id && Gun.obj.is(item)){
return gun.set(gun._.root.$.put(item, id), cb, opt);
if(Gun.obj.is(item)){;
item = gun.back(-1).get(soul = soul || Gun.node.soul(item) || gun.back('opt.uuid')()).put(item);
}
return gun.get((Gun.state.lex() + Gun.text.random(7))).put(item, cb, opt);
return gun.get(soul || (Gun.state.lex() + Gun.text.random(7))).put(item, cb, opt);
}
item.get(function(soul, o, msg){
if(!soul){ return cb.call(gun, {err: Gun.log('Only a node can be linked! Not "' + msg.put + '"!')}) }
@ -2215,4 +2214,4 @@
var noop = function(){};
})(USE, './adapters/websocket');
}());
}());

View File

@ -3,8 +3,8 @@ var config = {
port: 8765,
servers: 2,
browsers: 2,
each: 100000,
burst: 2,
each: 500,
burst: 50,
wait: 1,
notrad: true,
route: {