fix(plugins/topics): don't filter iconless topics when limit is disabled

This commit is contained in:
lowlighter
2022-06-24 11:53:55 -04:00
parent 5808186484
commit c23894a92a

View File

@@ -74,14 +74,10 @@ export default async function({login, data, imports, q, account}, {enabled = fal
topic.description = imports.htmlescape(topic.description) topic.description = imports.htmlescape(topic.description)
} }
//Filter topics with icon (icons)
if (type === "icons") {
console.debug(`metrics/compute/${login}/plugins > topics > filtering topics with icon`)
topics = topics.filter(({icon}) => icon)
}
//Limit topics (icons) //Limit topics (icons)
if ((type === "icons") && (limit > 0)) { if ((type === "icons") && (limit > 0)) {
console.debug(`metrics/compute/${login}/plugins > topics > filtering topics with icon`)
topics = topics.filter(({icon}) => icon)
console.debug(`metrics/compute/${login}/plugins > topics > keeping only ${limit} topics`) console.debug(`metrics/compute/${login}/plugins > topics > keeping only ${limit} topics`)
topics.splice(limit) topics.splice(limit)
} }