diff --git a/app/_document.tsx b/app/_document.tsx index 92561f9..2adac95 100644 --- a/app/_document.tsx +++ b/app/_document.tsx @@ -5,7 +5,7 @@ export default function Document() { - +
diff --git a/app/layout.tsx b/app/layout.tsx index 3d724f1..2e84c0d 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,7 +9,6 @@ import KeepOnlineWrapper from "@/components/layout/KeepOnlineWrapper" // Christmas theme disabled // import { ChristmasDecorations } from "@/components/christmas-decorations" // import { isDecember } from "@/lib/utils/christmas" -import { AudioPreloader } from "@/components/audio-preloader" const inter = Inter({ subsets: ["latin"] }) @@ -79,7 +78,6 @@ export default function RootLayout({ - {/* Christmas decorations disabled */} { // Preload the audio file - const audio = new Audio('/hohoho.mp3') + const audio = new Audio('/notification.mp3') audio.preload = 'auto' // Try to load it immediately diff --git a/components/dashboard/ChatDetail.tsx b/components/dashboard/ChatDetail.tsx index c31df24..81ab8ae 100644 --- a/components/dashboard/ChatDetail.tsx +++ b/components/dashboard/ChatDetail.tsx @@ -130,9 +130,9 @@ export default function ChatDetail({ chatId }: { chatId: string }) { // Initialize audio element useEffect(() => { // Create audio element for notification sound - audioRef.current = new Audio('/hohoho.mp3'); + audioRef.current = new Audio('/notification.mp3'); - // Fallback if hohoho.mp3 doesn't exist - use browser API for a simple beep + // Fallback if notification.mp3 doesn't exist - use browser API for a simple beep audioRef.current.addEventListener('error', () => { audioRef.current = null; }); diff --git a/components/dashboard/ChatTable.tsx b/components/dashboard/ChatTable.tsx index ff63394..62181a9 100644 --- a/components/dashboard/ChatTable.tsx +++ b/components/dashboard/ChatTable.tsx @@ -81,7 +81,7 @@ export default function ChatTable() { // Initialize audio element for notifications useEffect(() => { - audioRef.current = new Audio('/hohoho.mp3'); + audioRef.current = new Audio('/notification.mp3'); return () => { if (audioRef.current) { audioRef.current = null; diff --git a/components/layout/layout.tsx b/components/layout/layout.tsx index 6a6e9b5..0ea2880 100644 --- a/components/layout/layout.tsx +++ b/components/layout/layout.tsx @@ -5,6 +5,7 @@ import { useTheme } from "next-themes" import { usePathname } from "next/navigation" import Sidebar from "./sidebar" import UnifiedNotifications from "@/components/notifications/UnifiedNotifications" +import { AudioPreloader } from "@/components/audio-preloader" import type React from "react" interface LayoutProps { @@ -45,21 +46,24 @@ export default function Layout({ children }: LayoutProps) { } return ( -
- -
- {!isChatDetailPage && !isAdminPage && ( -
-
- -
-
- )} -
- {children} -
+ <> + +
+ +
+ {!isChatDetailPage && !isAdminPage && ( +
+
+ +
+
+ )} +
+ {children} +
+
-
+ ) } diff --git a/components/modals/broadcast-dialog.tsx b/components/modals/broadcast-dialog.tsx index 9880914..fd08064 100644 --- a/components/modals/broadcast-dialog.tsx +++ b/components/modals/broadcast-dialog.tsx @@ -83,6 +83,11 @@ export default function BroadcastDialog({ open, setOpen }: BroadcastDialogProps) }; const sendBroadcast = async () => { + // Prevent duplicate sends + if (isSending) { + return; + } + if ((!broadcastMessage || !broadcastMessage.trim()) && !selectedImage) { toast.warning("Please provide a message or image to broadcast."); return; diff --git a/components/notifications/OrderNotifications.tsx b/components/notifications/OrderNotifications.tsx index d10f488..1fff6e8 100644 --- a/components/notifications/OrderNotifications.tsx +++ b/components/notifications/OrderNotifications.tsx @@ -33,9 +33,9 @@ export default function OrderNotifications() { const audioRef = useRef(null); useEffect(() => { - audioRef.current = new Audio('/hohoho.mp3'); + audioRef.current = new Audio('/notification.mp3'); - // Fallback if hohoho.mp3 doesn't exist + // Fallback if notification.mp3 doesn't exist audioRef.current.addEventListener('error', () => { audioRef.current = null; }); diff --git a/lib/notification-context.tsx b/lib/notification-context.tsx index 9b97c74..0a500fe 100644 --- a/lib/notification-context.tsx +++ b/lib/notification-context.tsx @@ -92,7 +92,7 @@ export function NotificationProvider({ children }: NotificationProviderProps) { } // Initialize audio - audioRef.current = new Audio('/hohoho.mp3'); + audioRef.current = new Audio('/notification.mp3'); audioRef.current.addEventListener('error', () => { audioRef.current = null; });