diff --git a/gun.js b/gun.js index a99dbf2b..09129f16 100644 --- a/gun.js +++ b/gun.js @@ -598,7 +598,7 @@ return gun; } - Chain.set = function(val, cb, opt){ // TODO: NEEDS TESTS!!!!!! WARNING: Do we keep? + Chain.set = function(val, cb, opt){ var gun = this, ctx = {}, drift = Gun.time.now(); cb = cb || function(){}; opt = opt || {}; @@ -616,7 +616,7 @@ cb = cb || function(){}; gun._.at('null').once(function(key){ - if(gun.__.keys[key = (key || {}).key] || key.soul){ return } + if(key.soul || gun.__.keys[key = (key || {}).key] || gun.__.flag.start[key]){ return } // TODO! BUG? There WAS a timing bug with the above, but setTimeout seems to fix it compared to setImmediate. var kick = function(next){ if(++c){ return Gun.log("Warning! Multiple `not` resumes!"); } diff --git a/test/common.js b/test/common.js index dbdaea8b..3dfe84df 100644 --- a/test/common.js +++ b/test/common.js @@ -1419,7 +1419,9 @@ describe('Gun', function(){ .map().val(function(val){ // TODO! BUG? If we do gun.set it immediately calls and we get stale data. Is this wrong? expect(val).to.be(++i); if(4 === i){ - console.log("TODO? BUG! Double soul?", gun.__.graph); + done.i = 0; + Gun.obj.map(gun.__.graph, function(){ done.i++ }); + expect(done.i).to.be(1); // make sure there isn't double. done() } }); diff --git a/test/set.js b/test/set.js index cf5ea2b7..912c6ac3 100644 --- a/test/set.js +++ b/test/set.js @@ -1,6 +1,21 @@ -(function(){ return; // TODO! BUG! Causes tests to crash and burn badly. - +(function(){ return; var Gun = require('../gun'); + var done = function(){}; + + var gun = Gun().get('set').set(), i = 0; + gun.val(function(val){ + console.log('t1', val); + }).set(1).set(2).set(3).set(4) // if you set an object you'd have to do a `.back` + .map().val(function(val){ // TODO! BUG? If we do gun.set it immediately calls and we get stale data. Is this wrong? + console.log('t2', val, ++i); + if(4 === i){ + console.log("TODO? BUG! Double soul?", gun.__.graph); + done() + } + }); + + return; // TODO! BUG! Causes tests to crash and burn badly. + require('../lib/set'); var gun = Gun(); diff --git a/web/editor.html b/web/editor.html index 70e08a27..33a0fb44 100644 --- a/web/editor.html +++ b/web/editor.html @@ -52,7 +52,8 @@ editor.on("change", function change() { }); function live() { - var frame = $('iframe')[0]; + var frame = $('iframe').height($('.CodeMirror').height() * .95)[0]; + $('iframe').height($('.CodeMirror').height()); frame = frame.contentDocument || frame.contentWindow.document; frame.open(); frame.write(editor.getValue()); diff --git a/web/think.html b/web/think.html index eb057a2a..f9714dc2 100644 --- a/web/think.html +++ b/web/think.html @@ -9,7 +9,7 @@
Before we can start building anything interesting, we should have a way to jot down our thoughts. Therefore the first thing we will build is a tool to keep track of what needs to be done. The infamous To-Do app, allowing us to keep temporary notes.
-So what are the requirements? The ability to add a note, read our notes, and clear them off. Additionally, we need a space to keep these notes in, and a web page to access them through. Let's start with the page!
+So what are the requirements? The ability to add a note, read our notes, and to clear them off. Additionally, we need a space to keep these notes in, and a web page to access them through. Let's start with the page! You can edit the code below.
Fantastic! Now that we can successfully store data, we want show the data!
+