Refactor nesting in loadTagCounts()
parent
5ff664e725
commit
cae923b68a
|
|
@ -313,12 +313,11 @@ async function loadTagCounts() {
|
||||||
// Not the best code, but it works I guess?
|
// Not the best code, but it works I guess?
|
||||||
if (resp) {
|
if (resp) {
|
||||||
for (let post of pop.posts)
|
for (let post of pop.posts)
|
||||||
for (let tag of resp.results)
|
for (let tag of resp.results) {
|
||||||
for (let postTag of post.tags)
|
post.tags
|
||||||
if (tag.names.includes(postTag.name)) {
|
.find(postTag => tag.names.includes(postTag.name))
|
||||||
postTag.usages = tag.usages;
|
.usages = tag.usages;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue