Refactor nesting in loadTagCounts()

pull/55/head
G1org1owo 2024-07-09 01:31:35 +02:00
parent 5ff664e725
commit cae923b68a
1 changed files with 5 additions and 6 deletions

View File

@ -313,12 +313,11 @@ async function loadTagCounts() {
// Not the best code, but it works I guess?
if (resp) {
for (let post of pop.posts)
for (let tag of resp.results)
for (let postTag of post.tags)
if (tag.names.includes(postTag.name)) {
postTag.usages = tag.usages;
break;
}
for (let tag of resp.results) {
post.tags
.find(postTag => tag.names.includes(postTag.name))
.usages = tag.usages;
}
}
}
}