diff --git a/frontend/app/agent/dashboard/page.tsx b/frontend/app/agent/dashboard/page.tsx index cc6b890..bea6cb2 100644 --- a/frontend/app/agent/dashboard/page.tsx +++ b/frontend/app/agent/dashboard/page.tsx @@ -1,7 +1,11 @@ +import { Suspense } from "react"; import { DashboardShell } from "@/components/dashboard/DashboardShell"; export default function AgentDashboardPage() { - // 页面采用纯客户端渲染,所有业务逻辑由 DashboardShell 承担 - return ; + return ( +
加载中...
}> + +
+ ); } diff --git a/frontend/components/visitor/ChatWidget.tsx b/frontend/components/visitor/ChatWidget.tsx index 4453e4c..b1d3c2d 100644 --- a/frontend/components/visitor/ChatWidget.tsx +++ b/frontend/components/visitor/ChatWidget.tsx @@ -260,9 +260,9 @@ export function ChatWidget({ visitorId, isOpen, onToggle }: ChatWidgetProps) { return; } - // 如果是客服发送的消息(不是访客自己发送的),播放提示音 - if (message.sender_is_agent) { - playNotificationSound(soundEnabled); + // 如果是客服发送的消息(不是访客自己发送的)且开启声音,播放提示音 + if (message.sender_is_agent && soundEnabled) { + playNotificationSound(); } setMessages((prev) => { diff --git a/frontend/features/agent/hooks/useMessages.ts b/frontend/features/agent/hooks/useMessages.ts index 2e75b65..6e3cf7e 100644 --- a/frontend/features/agent/hooks/useMessages.ts +++ b/frontend/features/agent/hooks/useMessages.ts @@ -234,7 +234,7 @@ export function useMessages({ (message: MessageItem) => { // 如果是访客发送的消息(不是客服自己发送的),播放提示音 if (!message.sender_is_agent && soundEnabled) { - playNotificationSound(soundEnabled); + playNotificationSound(); } // 检查对话是否存在 diff --git a/frontend/lib/constants/agent-pages.tsx b/frontend/lib/constants/agent-pages.tsx index 38a9770..a5e629a 100644 --- a/frontend/lib/constants/agent-pages.tsx +++ b/frontend/lib/constants/agent-pages.tsx @@ -52,6 +52,7 @@ export const AGENT_PAGES = [ label: "对话", title: "对话", Icon: MessageCircle, + adminOnly: false, isChatPage: true, }, { @@ -59,6 +60,7 @@ export const AGENT_PAGES = [ label: "知识库测试", title: "知识库测试", Icon: Lightbulb, + adminOnly: false, isChatPage: true, }, { @@ -66,6 +68,7 @@ export const AGENT_PAGES = [ label: "知识库", title: "知识库", Icon: BookOpen, + adminOnly: false, component: KnowledgePage, }, { @@ -73,6 +76,7 @@ export const AGENT_PAGES = [ label: "事件管理", title: "事件管理", Icon: ClipboardList, + adminOnly: false, component: FAQsPage, }, { @@ -88,17 +92,18 @@ export const AGENT_PAGES = [ label: "AI 配置", title: "AI 配置", Icon: Settings, + adminOnly: false, component: SettingsPage, }, ] as const; export type NavigationPage = (typeof AGENT_PAGES)[number]["id"]; -const VALID_PAGE_IDS = new Set(AGENT_PAGES.map((p) => p.id)); +const VALID_PAGE_IDS = new Set(AGENT_PAGES.map((p) => p.id)); export function getPageFromSearchParams(searchParams: URLSearchParams | null): NavigationPage { const p = searchParams?.get("page") ?? null; - if (p && VALID_PAGE_IDS.has(p)) return p as NavigationPage; + if (p != null && VALID_PAGE_IDS.has(p)) return p as NavigationPage; return "dashboard"; }