Skip to content

Commit

Permalink
Fix order tab navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckless-Satoshi committed Jan 2, 2024
1 parent e885585 commit 42591b3
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions frontend/src/basic/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,8 @@ import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageCon
const NavBar = (): JSX.Element => {
const theme = useTheme();
const { t } = useTranslation();
const {
page,
setPage,
settings,
setSlideDirection,
open,
setOpen,
windowSize,
navbarHeight,
hostUrl,
} = useContext<UseAppStoreType>(AppContext);
const { page, setPage, settings, setSlideDirection, open, setOpen, windowSize, navbarHeight } =
useContext<UseAppStoreType>(AppContext);
const { garage, orderUpdatedAt, robotUpdatedAt } = useContext<UseGarageStoreType>(GarageContext);

const navigate = useNavigate();
Expand Down Expand Up @@ -62,6 +53,9 @@ const NavBar = (): JSX.Element => {
navigate('/robot');
setPage('robot');
}
if (isPage(pathPage) && pathPage.includes('order')) {
setPage(pathPage);
}
}, [location, navigate, setPage, orderUpdatedAt, robotUpdatedAt]);

const handleSlideDirection = function (oldPage: Page, newPage: Page): void {
Expand Down

0 comments on commit 42591b3

Please sign in to comment.