From 7b2b78c4386fe467a7fbe0da33d6c032c863eb06 Mon Sep 17 00:00:00 2001 From: VividTruthKeeper Date: Sat, 25 Feb 2023 01:42:17 +0500 Subject: [PATCH] wrong cat bug --- src/components/header/SubNav.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/header/SubNav.tsx b/src/components/header/SubNav.tsx index aac7154..5130cc0 100644 --- a/src/components/header/SubNav.tsx +++ b/src/components/header/SubNav.tsx @@ -49,7 +49,8 @@ const SubNav = () => { onClickLink(0); return; } - const category = location.pathname[location.pathname.length - 1]; + const category = + location.pathname.split("/")[location.pathname.split("/").length - 1]; onClickLink(parseInt(category)); }, [location]);