Commit c00eb7b5539d007fd4b13257e728664de6831106
add getLatest to publish
Paul Frazee committed on 3/5/2015, 2:27:00 AMParent: 6f08d9afa56813ff9dec9f01b4be2719ed36a373
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -61,12 +61,12 @@ | ||
61 | 61 … | }) |
62 | 62 … | } |
63 | 63 … | |
64 | 64 … | client.publish = function (content, cb) { |
65 | - // :TODO: get prev | |
66 | - var prev = null | |
67 | - var msg = createMsg(client.keys, null, content, prev) | |
68 | - rpc.add(msg, cb) | |
65 … | + rpc.getLatest(function (err, prev) { | |
66 … | + var msg = createMsg(client.keys, null, content, prev||null) | |
67 … | + rpc.add(msg, cb) | |
68 … | + }) | |
69 | 69 … | } |
70 | 70 … | |
71 | 71 … | client.auth = function (cb) { |
72 | 72 … | var authReq = ssbKeys.signObj(client.keys, { |
Built with git-ssb-web