From 21257424a5b7ea48df97a214cd52a6f405107b71 Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Tue, 27 Sep 2016 12:23:59 -0700 Subject: [PATCH] localStorage should recover from a get response --- gun.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gun.js b/gun.js index 848e8968..0a137d7b 100644 --- a/gun.js +++ b/gun.js @@ -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!");