aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-08 15:57:43 -0800
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-12-08 15:57:43 -0800
commit7c57c1321fc73354ed03fe8fae1263bf5acfe329 (patch)
tree8b7b30a2105c9560b498156508baf8aa3bff3689 /lib/render-msg.js
parent416264d7b5ed819683c4efd89db7aeef6e47595c (diff)
downloadpatchfoo-7c57c1321fc73354ed03fe8fae1263bf5acfe329.tar.gz
patchfoo-7c57c1321fc73354ed03fe8fae1263bf5acfe329.zip
Don't show empty message lists
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 7d34fc3..adf13bb 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -1070,13 +1070,15 @@ RenderMsg.prototype.npmPackages = function (cb) {
}
self.render.npmPackageMentions(self.c.mentions, function (err, el) {
if (err) return cb(err)
+ var dependencyLinks = u.toArray(self.c.dependencyBranch)
+ var versionLinks = u.toArray(self.c.versionBranch)
self.wrap(h('div', [
el,
- Array.isArray(self.c.dependencyBranch) ? h('div',
- 'dependencies via: ', self.c.dependencyBranch.map(renderIdLink)
+ dependencyLinks.length ? h('div',
+ 'dependencies via: ', dependencyLinks.map(renderIdLink)
) : '',
- Array.isArray(self.c.versionBranch) ? h('div',
- 'previous versions: ', self.c.versionBranch.map(renderIdLink)
+ versionLinks.length ? h('div',
+ 'previous versions: ', versionLinks.map(renderIdLink)
) : ''
]), elCb)
return done(cb)