From 1608b8beecf001138f29cb7618a15544f8562a20 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 21 Jan 2021 13:15:23 +0100 Subject: [PATCH] Fix topics plugin to avoid displaying "And 0 more..." when they are less topics than limit --- source/plugins/topics/index.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugins/topics/index.mjs b/source/plugins/topics/index.mjs index 3f079847..b18e8ec0 100644 --- a/source/plugins/topics/index.mjs +++ b/source/plugins/topics/index.mjs @@ -57,7 +57,8 @@ if ((mode === "starred")&&(limit > 0)) { console.debug(`metrics/compute/${login}/plugins > topics > keeping only ${limit} topics`) const removed = topics.splice(limit) - topics.push({name:`And ${removed.length} more...`, description:removed.map(({name}) => name).join(", "), icon:null}) + if (removed.length) + topics.push({name:`And ${removed.length} more...`, description:removed.map(({name}) => name).join(", "), icon:null}) } //Convert icons to base64 console.debug(`metrics/compute/${login}/plugins > topics > loading artworks`)