debug(feed): 给 articlesWithPrompts 加 console.log 诊断 wrapper 不渲染

This commit is contained in:
xiaji
2026-06-16 09:15:41 +08:00
parent 90d1a34003
commit 95d227f70f

View File

@@ -44,9 +44,12 @@ let categoryPromptTimer: number | null = null
// - items 没这条 → 不渲染(孤儿) // - items 没这条 → 不渲染(孤儿)
// - items 有 + Map 也有 → 渲染 // - items 有 + Map 也有 → 渲染
// - items 有 + Map 没 → 不渲染(用户已 dismiss/确认/超时) // - items 有 + Map 没 → 不渲染(用户已 dismiss/确认/超时)
const articlesWithPrompts = computed(() => const articlesWithPrompts = computed(() => {
items.value.filter((a) => (categoryPromptsByArticle.value.get(a.id)?.length ?? 0) > 0) const result = items.value.filter((a) => (categoryPromptsByArticle.value.get(a.id)?.length ?? 0) > 0)
) // eslint-disable-next-line no-console
console.log('[articlesWithPrompts] computed:', { itemsLen: items.value.length, mapSize: categoryPromptsByArticle.value.size, resultLen: result.length, mapEntries: Array.from(categoryPromptsByArticle.value.entries()) })
return result
})
// 移除某篇文章的所有提示条(8 秒超时 / 确认后 / 过滤变化) // 移除某篇文章的所有提示条(8 秒超时 / 确认后 / 过滤变化)
function clearPromptsForArticle(articleId: number) { function clearPromptsForArticle(articleId: number) {