diff --git a/frontend/src/basic/MakerPage/index.tsx b/frontend/src/basic/MakerPage/index.tsx index 8d5dead1..5066645b 100644 --- a/frontend/src/basic/MakerPage/index.tsx +++ b/frontend/src/basic/MakerPage/index.tsx @@ -14,7 +14,7 @@ import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageCon const MakerPage = (): JSX.Element => { const { fav, windowSize, navbarHeight } = useContext(AppContext); - const { federation } = useContext(FederationContext); + const { federation, setDelay } = useContext(FederationContext); const { garage, maker } = useContext(GarageContext); const { t } = useTranslation(); const navigate = useNavigate(); @@ -50,9 +50,10 @@ const MakerPage = (): JSX.Element => { maker.paymentMethods, ]); - const onOrderClicked = function (id: number): void { + const onOrderClicked = function (id: number, shortAlias: string): void { if (garage.getSlot()?.hashId) { - navigate(`/order/${id}`); + setDelay(10000); + navigate(`/order/${shortAlias}/${id}`); } else { setOpenNoRobot(true); } diff --git a/frontend/src/basic/NavBar/NavBar.tsx b/frontend/src/basic/NavBar/NavBar.tsx index 9306a24a..8c797955 100644 --- a/frontend/src/basic/NavBar/NavBar.tsx +++ b/frontend/src/basic/NavBar/NavBar.tsx @@ -46,6 +46,10 @@ const NavBar = (): JSX.Element => { settings: 5, }; + useEffect(() => { + // re-render on orde rand robot updated at for latest orderId in tab + }, [robotUpdatedAt]); + useEffect(() => { // change tab (page) into the current route const pathPage: Page | string = location.pathname.split('/')[1]; @@ -53,10 +57,10 @@ const NavBar = (): JSX.Element => { navigate('/robot'); setPage('robot'); } - if (isPage(pathPage) && pathPage.includes('order')) { + if (isPage(pathPage)) { setPage(pathPage); } - }, [location, navigate, orderUpdatedAt, robotUpdatedAt]); + }, [location]); const handleSlideDirection = function (oldPage: Page, newPage: Page): void { const oldPos: number = pagesPosition[oldPage];