fix(EventList): 删除重复的 Toast 通知,统一使用右下角通知卡片
**问题描述** 新事件推送时显示两种通知: 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 <noreply@anthropic.com>
This commit is contained in:
@@ -55,19 +55,6 @@ const EventList = ({ events, pagination, onPageChange, onEventClick, onViewDetai
|
|||||||
console.log('[EventList DEBUG] 事件标题:', event?.title);
|
console.log('[EventList DEBUG] 事件标题:', event?.title);
|
||||||
logger.info('EventList', '收到新事件推送', event);
|
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] 准备发送浏览器原生通知');
|
||||||
console.log('[EventList DEBUG] 通知权限状态:', browserPermission);
|
console.log('[EventList DEBUG] 通知权限状态:', browserPermission);
|
||||||
|
|||||||
Reference in New Issue
Block a user