diff --git a/gun.js b/gun.js index 044eb0fc..99005afe 100644 --- a/gun.js +++ b/gun.js @@ -1818,7 +1818,9 @@ if(typeof field === 'string'){ tmp = field.split(opt.split || '.'); if(1 === tmp.length){ - return back.get(field, cb, opt); + gun = back.get(field, cb, opt); + gun._.opt = opt; + return gun; } field = tmp; } @@ -1835,12 +1837,15 @@ } else { gun = back.get(field[0], cb, opt); } + gun._.opt = opt; return gun; } if(!field && 0 != field){ return back; } - return back.get(''+field, cb, opt); + gun = back.get(''+field, cb, opt); + gun._.opt = opt; + return gun; } ;(function(){ @@ -2031,7 +2036,7 @@ var store = root.localStorage || {setItem: noop, removeItem: noop, getItem: noop}; function put(at){ var err, id, opt, root = at.gun._.root; - (opt = at.opt || {}).prefix = opt.prefix || (at.gun.Back('opt')||{}).prefix || 'gun/'; + (opt = at.opt || {}).prefix = opt.prefix || at.gun.Back('opt.prefix') || 'gun/'; Gun.graph.is(at.put, function(node, soul){ //try{store.setItem(opt.prefix + soul, Gun.text.ify(node)); try{store.setItem(opt.prefix + soul, Gun.text.ify(root._.graph[soul]||node)); @@ -2043,7 +2048,7 @@ function get(at){ var gun = at.gun, lex = at.get, soul, data, opt, u; //setTimeout(function(){ - (opt = at.opt || {}).prefix = opt.prefix || (at.gun.Back('opt')||{}).prefix || 'gun/'; + (opt = at.opt || {}).prefix = opt.prefix || at.gun.Back('opt.prefix') || 'gun/'; if(!lex || !(soul = lex[Gun._.soul])){ return } data = Gun.obj.ify(store.getItem(opt.prefix + soul) || null); if(!data){ return } // localStorage isn't trustworthy to say "not found".