From 001290ba71d3720a2c9339ba7dd83e0fcb7bdca5 Mon Sep 17 00:00:00 2001
From: Wolfboy248 <georgejvindkarlsen@gmail.com>
Date: Tue, 10 Dec 2024 09:42:48 +0100
Subject: fix/frontent: fix category parameter not working

---
 frontend/src/pages/Maplist.tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'frontend/src/pages/Maplist.tsx')

diff --git a/frontend/src/pages/Maplist.tsx b/frontend/src/pages/Maplist.tsx
index 8fc52b0..7b4ce06 100644
--- a/frontend/src/pages/Maplist.tsx
+++ b/frontend/src/pages/Maplist.tsx
@@ -87,7 +87,13 @@ const Maplist: React.FC = () => {
     }
   }, [gameChapters])
 
-
+  useEffect(() => {
+	  const queryParams = new URLSearchParams(location.search);
+	  const cat = queryParams.get("cat");
+	  if (cat != null) {
+		  setCatNum(parseFloat(cat) - 1);
+	  }
+  }, [location])
 
   return (
     <main>
-- 
cgit v1.2.3

