diff --git a/styles/TopAppBar.tsx b/styles/TopAppBar.tsx index 4775268..ab824fa 100644 --- a/styles/TopAppBar.tsx +++ b/styles/TopAppBar.tsx @@ -14,7 +14,11 @@ const TopAppBar: React.FC<{ router: any }> = ({ router }) => { routes.findIndex(({ pathname }) => pathname === router.pathname) ); router.events.on("routeChangeStart", (url: string) => { - setValue(routes.findIndex(({ pathname }) => pathname === url)); + setValue( + routes.findIndex( + ({ pathname }) => pathname === url.replace(/(?<=.)\/$/, "") + ) + ); }); return (