fix(pos): alert on waiter calls / guest orders on the POS & queue display
CI/CD / CI · API (dotnet build + test) (push) Successful in 46s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 28s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m10s
CI/CD / CI · Admin Web (tsc) (push) Successful in 38s
CI/CD / CI · Website (tsc) (push) Successful in 48s
CI/CD / CI · Koja (tsc) (push) Successful in 51s
CI/CD / Deploy · all services (push) Successful in 3m3s

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 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-25 09:27:54 +03:30
parent 166f2b2586
commit eaf911e12c
@@ -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