From 76a4c0157738811ab645e91818683dc655e5d6df Mon Sep 17 00:00:00 2001 From: neobooru <50623835+neobooru@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:34:00 +0200 Subject: [PATCH] Fix linter warning --- src/popup/pages/PopupMain.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/popup/pages/PopupMain.vue b/src/popup/pages/PopupMain.vue index 5c198b8..a5d5d75 100644 --- a/src/popup/pages/PopupMain.vue +++ b/src/popup/pages/PopupMain.vue @@ -314,9 +314,9 @@ async function loadTagCounts() { if (resp) { for (let post of pop.posts) for (let tag of resp.results) { - post.tags - .find(postTag => tag.names.includes(postTag.name)) - .usages = tag.usages; + // @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; } } }