aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/render-msg.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 09eb3e2..23e236f 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -220,10 +220,21 @@ RenderMsg.prototype.markdown = function (cb) {
RenderMsg.prototype.post = function (cb) {
var self = this
- self.link(self.c.root, function (err, a) {
+ var done = multicb({pluck: 1, spread: true})
+ var branchDone = multicb({pluck: 1})
+ u.toArray(self.c.branch).forEach(function (branch) {
+ self.link(branch, branchDone())
+ })
+ if (self.c.root === self.c.branch) done()()
+ else self.link(self.c.root, done())
+ branchDone(done())
+ done(function (err, rootLink, branchLinks) {
if (err) return self.wrap(u.renderError(err), cb)
self.wrap(h('div.ssb-post',
- a ? h('div', h('small', 're: ', a)) : '',
+ rootLink ? h('div', h('small', '>> ', rootLink)) : '',
+ branchLinks.map(function (a, i) {
+ return h('div', h('small', '> ', a))
+ }),
h('div.ssb-post-text', {innerHTML: self.markdown()})
), cb)
})