diff --git a/src/_app/App.tsx b/src/_app/App.tsx index 0b6823c71270cb95ac49dba61950fc3eefdf36e4..20d42451aa40fdefa3335e97e42c8a9c68dc3d1c 100644 --- a/src/_app/App.tsx +++ b/src/_app/App.tsx @@ -25,6 +25,7 @@ import S from './App.module.css'; import APP_ROUTE from "./config/route"; import Wrapper from "./modules/wrapper/Wrapper"; +import type { CartItemPostModel } from "../pages/cart-page/config/type"; import type { MutableRefObject } from 'react'; @@ -47,6 +48,13 @@ function App() { socket.current = new Socket(); console.log(socket.current); + + socket.current?.onOrder((d: CartItemPostModel) => { + console.log(d); + setToastItem({ + id: '', title: d.shopId, description: d.waitingCount.toString(), goto: '' + }); + }); return () => socket.current?.disconnect(); }, [login]);