Fix undefined tag usages access in PopupMain.vue

pull/72/head
G1org1owo 2025-04-27 23:03:10 +02:00 committed by Neo
parent ce6a6c6521
commit 1a6fe13512
1 changed files with 2 additions and 3 deletions

View File

@ -301,9 +301,8 @@ async function loadTagCounts() {
if (resp) {
for (let post of pop.posts)
for (let tag of resp.results) {
// @ts-expect-error .find() can't return undefined because the resp.results list can only contain
// the tags which we requested. And we only request the tags which are already set on the post.
post.tags.find((postTag) => tag.names.includes(postTag.name)).usages = tag.usages;
const postTag = post.tags.find((postTag) => tag.names.includes(postTag.name));
if(postTag) postTag.usages = tag.usages;
}
}
}