From 52369763075d4ff0c66482101821d1af6dfe6bd8 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 30 Oct 2025 18:39:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(EventList):=20=E5=88=A0=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84=20Toast=20=E9=80=9A=E7=9F=A5=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E5=8F=B3=E4=B8=8B=E8=A7=92?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **问题描述** 新事件推送时显示两种通知: 1. ❌ 左侧顶部绿色 Toast(重复多次) 2. ✅ 右下角通知卡片(NotificationContainer) 用户反馈:只需要右下角通知卡片,不需要 Toast 提示 **修复内容** 删除 EventList.js 中的 Chakra UI Toast 通知代码(13 行): ```diff - console.log('[EventList DEBUG] 准备显示 Toast 通知'); - // 显示 Toast 通知 - 更明显的配置 - const toastId = toast({ - title: '🔔 新事件发布', - description: event.title, - status: 'success', - duration: 8000, - isClosable: true, - position: 'top', - variant: 'solid', - }); - console.log('[EventList DEBUG] ✓ Toast 通知已调用,ID:', toastId); ``` **保留的通知能力** - ✅ 右下角通知卡片(NotificationContainer) - ✅ 浏览器原生通知(需用户授权) - ✅ 事件列表实时更新 - ✅ PostHog 埋点追踪 **验证** 刷新页面后,新事件推送时: - ❌ 不再显示左侧 Toast - ✅ 只显示右下角通知卡片 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/views/Community/components/EventList.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/views/Community/components/EventList.js b/src/views/Community/components/EventList.js index 0eeffae6..0dabe86d 100644 --- a/src/views/Community/components/EventList.js +++ b/src/views/Community/components/EventList.js @@ -55,19 +55,6 @@ const EventList = ({ events, pagination, onPageChange, onEventClick, onViewDetai console.log('[EventList DEBUG] 事件标题:', event?.title); logger.info('EventList', '收到新事件推送', event); - console.log('[EventList DEBUG] 准备显示 Toast 通知'); - // 显示 Toast 通知 - 更明显的配置 - const toastId = toast({ - title: '🔔 新事件发布', - description: event.title, - status: 'success', // 改为 success,更醒目 - duration: 8000, // 延长显示时间到 8 秒 - isClosable: true, - position: 'top', // 改为顶部居中,更显眼 - variant: 'solid', // 改为 solid,背景更明显 - }); - console.log('[EventList DEBUG] ✓ Toast 通知已调用,ID:', toastId); - // 发送浏览器原生通知 console.log('[EventList DEBUG] 准备发送浏览器原生通知'); console.log('[EventList DEBUG] 通知权限状态:', browserPermission);