Fix undefined tag usages access in PopupMain.vue
parent
c08e6473e9
commit
3e32fdb83f
|
|
@ -314,9 +314,8 @@ async function loadTagCounts() {
|
||||||
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) {
|
||||||
// @ts-expect-error .find() can't return undefined because the resp.results list can only contain
|
const postTag = post.tags.find((postTag) => tag.names.includes(postTag.name));
|
||||||
// the tags which we requested. And we only request the tags which are already set on the post.
|
if(postTag) postTag.usages = tag.usages;
|
||||||
post.tags.find((postTag) => tag.names.includes(postTag.name)).usages = tag.usages;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue