Fix undefined tag usages access in PopupMain.vue

pull/67/head
G1org1owo 2025-04-27 23:03:10 +02:00
parent c08e6473e9
commit 3e32fdb83f
No known key found for this signature in database
GPG Key ID: 29D76843C000CEF9
1 changed files with 2 additions and 3 deletions

View File

@ -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;
} }
} }
} }