From 7c57c1321fc73354ed03fe8fae1263bf5acfe329 Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 8 Dec 2017 15:57:43 -0800 Subject: Don't show empty message lists --- lib/render-msg.js | 10 ++++++---- 1 file 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) -- cgit v1.2.3