Fix topics plugin to avoid displaying "And 0 more..." when they are less topics than limit

This commit is contained in:
lowlighter
2021-01-21 13:15:23 +01:00
parent 3f5bf4d531
commit 1608b8beec

View File

@@ -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`)