From 98415e1e6803472c7ccd2402fba1ad37d03e4076 Mon Sep 17 00:00:00 2001 From: xiaji Date: Tue, 16 Jun 2026 09:22:10 +0800 Subject: [PATCH] =?UTF-8?q?chore(feed):=20=E7=A7=BB=E9=99=A4=20debug=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Feed.vue | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/Feed.vue b/frontend/src/views/Feed.vue index 2986614..627df45 100644 --- a/frontend/src/views/Feed.vue +++ b/frontend/src/views/Feed.vue @@ -44,12 +44,9 @@ let categoryPromptTimer: number | null = null // - items 没这条 → 不渲染(孤儿) // - items 有 + Map 也有 → 渲染 // - items 有 + Map 没 → 不渲染(用户已 dismiss/确认/超时) -const articlesWithPrompts = computed(() => { - 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 -}) +const articlesWithPrompts = computed(() => + items.value.filter((a) => (categoryPromptsByArticle.value.get(a.id)?.length ?? 0) > 0) +) // 移除某篇文章的所有提示条(8 秒超时 / 确认后 / 过滤变化) function clearPromptsForArticle(articleId: number) { @@ -57,16 +54,12 @@ function clearPromptsForArticle(articleId: number) { const next = new Map(categoryPromptsByArticle.value) next.delete(articleId) categoryPromptsByArticle.value = next - // eslint-disable-next-line no-console - console.log('[clearPromptsForArticle] called for', articleId, 'stack:', new Error().stack?.split('\n').slice(1, 4).join(' | ')) } } // 全清 function clearAllPrompts() { if (categoryPromptsByArticle.value.size > 0) { - // eslint-disable-next-line no-console - console.log('[clearAllPrompts] called, stack:', new Error().stack?.split('\n').slice(1, 4).join(' | ')) categoryPromptsByArticle.value = new Map() } if (categoryPromptTimer !== null) {