mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Update gun.js
This commit is contained in:
parent
d1c4df7688
commit
9355a36a54
6
gun.js
6
gun.js
@ -2031,8 +2031,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 || ( at.opt = at.gun.Back('opt') || {} );
|
||||
opt.prefix = 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));
|
||||
@ -2044,8 +2043,7 @@
|
||||
function get(at){
|
||||
var gun = at.gun, lex = at.get, soul, data, opt, u;
|
||||
//setTimeout(function(){
|
||||
opt = at.opt || ( at.opt = at.gun.Back('opt') || {} );
|
||||
opt.prefix = 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".
|
||||
|
Loading…
x
Reference in New Issue
Block a user