localStorage should recover from a get response

This commit is contained in:
Mark Nadal 2016-09-27 12:23:59 -07:00 committed by GitHub
parent f748ef0308
commit 21257424a5

3
gun.js
View File

@ -2082,11 +2082,12 @@
'$': at.get // msg BODY
};
Tab.on(msg['#'], function(err, data){ // TODO: ONE? PERF! Clear out listeners, maybe with setTimeout?
at.gun.Back(-1).on('in', {'@': at['#'], err: err, put: data});
at.gun.Back(-1).on('out', {'@': at['#'], err: err, put: data});
});
Tab.peers(peers).send(msg, {headers: {'gun-sid': Tab.server.sid}});
});
Gun.on('put', function(at){
if(at['@']){ return }
var opt = at.gun.Back('opt') || {}, peers = opt.peers;
if(!peers || Gun.obj.empty(peers)){
Gun.log.once('peers', "Warning! You have no peers to save to!");