From eaf911e12c3de2fddbe506c3295c9cb8a8150163 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 25 Jun 2026 09:27:54 +0330 Subject: [PATCH] fix(pos): alert on waiter calls / guest orders on the POS & queue display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The call-waiter flow was fully wired (guest QR button → public endpoint → NotifyCallWaiterAsync persists + broadcasts NotificationReceived), but the alert hook (useOrderAlerts: sound + toast + desktop popup) and the bell live only in the (dashboard) layout. During service staff are on the POS (fullscreen) layout, which mounted neither — so a waiter call produced nothing where staff actually stand. Mount useOrderAlerts in the (fullscreen) layout so POS / queue-display get the chime + toast for waiter calls and new guest orders. (KDS is a dashboard route, already covered.) Co-Authored-By: Claude Opus 4.8 --- web/dashboard/src/app/[locale]/(fullscreen)/layout.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/dashboard/src/app/[locale]/(fullscreen)/layout.tsx b/web/dashboard/src/app/[locale]/(fullscreen)/layout.tsx index 359a336..a99ed03 100644 --- a/web/dashboard/src/app/[locale]/(fullscreen)/layout.tsx +++ b/web/dashboard/src/app/[locale]/(fullscreen)/layout.tsx @@ -6,6 +6,7 @@ import { Loader2 } from "lucide-react"; import { useRouter } from "@/i18n/routing"; import { useAuthStore } from "@/lib/stores/auth.store"; import { RouteGuard } from "@/components/auth/route-guard"; +import { useOrderAlerts } from "@/lib/realtime/use-order-alerts"; /** Full-viewport routes (POS, queue TV display) — auth only, no dashboard chrome. */ export default function FullscreenLayout({ children }: { children: React.ReactNode }) { @@ -15,6 +16,10 @@ export default function FullscreenLayout({ children }: { children: React.ReactNo const hasHydrated = useAuthStore((s) => s._hasHydrated); const dir = locale === "en" ? "ltr" : "rtl"; + // Surface café notifications (waiter calls, new guest orders) on the POS / + // queue-display too — during service staff are here, not on the dashboard. + useOrderAlerts(); + useEffect(() => { // Only redirect AFTER the persisted auth has rehydrated from localStorage — // otherwise a page refresh sees the empty initial state and bounces an