mirror of
https://github.com/amark/gun.git
synced 2025-06-03 20:56:43 +00:00
fix @ThinkingJoules 's import 'cannot link undefined' error
This commit is contained in:
parent
996db1a42e
commit
3d796b4014
@ -16,7 +16,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<a id="share" class="hide"><div class="stick button">Share</div></a>
|
||||
<a id="share" class="hide"><div class="stick button">Request Ride</div></a>
|
||||
<div id="link" class="hide">
|
||||
<p>Copy and Paste this URL to your friends to share your location:</p>
|
||||
<center>
|
||||
|
13
gun.js
13
gun.js
@ -400,7 +400,7 @@
|
||||
return n;
|
||||
}
|
||||
State.to = function(from, k, to){
|
||||
var val = from[k]; // BUGGY!
|
||||
var val = (from||{})[k];
|
||||
if(obj_is(val)){
|
||||
val = obj_copy(val);
|
||||
}
|
||||
@ -1287,13 +1287,16 @@
|
||||
return at;
|
||||
}
|
||||
function soul(gun, cb, opt, as){
|
||||
var cat = gun._, tmp;
|
||||
var cat = gun._, acks = 0, tmp;
|
||||
if(tmp = cat.soul){ return cb(tmp, as, cat), gun }
|
||||
if(tmp = cat.link){ return cb(tmp, as, cat), gun }
|
||||
gun.get(function(msg, ev){ // TODO: Bug! Needs once semantics?
|
||||
gun.get(function(msg, ev){
|
||||
if(u === msg.put && (tmp = (obj_map(cat.root.opt.peers, function(v,k,t){t(k)})||[]).length) && acks++ <= tmp){
|
||||
return;
|
||||
}
|
||||
ev.rid(msg);
|
||||
var at = ((at = msg.$) && at._) || {};
|
||||
tmp = at.link || at.soul || rel.is(msg.put) || node_soul(msg.put);
|
||||
tmp = at.link || at.soul || rel.is(msg.put) || node_soul(msg.put) || at.dub;
|
||||
cb(tmp, as, msg, ev);
|
||||
}, {out: {get: {'.':true}}});
|
||||
return gun;
|
||||
@ -1344,7 +1347,7 @@
|
||||
//obj.del(map, at); // TODO: Warning: This unsubscribes ALL of this chain's listeners from this link, not just the one callback event.
|
||||
return;
|
||||
}
|
||||
var obj = Gun.obj, obj_has = obj.has, obj_to = Gun.obj.to;
|
||||
var obj = Gun.obj, obj_map = obj.map, obj_has = obj.has, obj_to = Gun.obj.to;
|
||||
var num_is = Gun.num.is;
|
||||
var rel = Gun.val.link, node_soul = Gun.node.soul, node_ = Gun.node._;
|
||||
var empty = {}, u;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gun",
|
||||
"version": "0.9.999993",
|
||||
"version": "0.9.999994",
|
||||
"description": "A realtime, decentralized, offline-first, graph data synchronization engine.",
|
||||
"main": "index.js",
|
||||
"browser": "gun.min.js",
|
||||
|
@ -3705,6 +3705,7 @@ describe('Gun', function(){
|
||||
});
|
||||
|
||||
it('Multiple subscribes should trigger', function(done){
|
||||
// thanks to @ivkan for reporting and providing test.
|
||||
var gun = Gun();
|
||||
var check = {};
|
||||
gun.get('m/s/key').put({property: 'value'});
|
||||
|
Loading…
x
Reference in New Issue
Block a user