From fa2c5c117a0407bf97be8468730b716ead19e1c9 Mon Sep 17 00:00:00 2001 From: alok8bb Date: Thu, 27 Jun 2024 16:06:00 +0530 Subject: [PATCH] fix: handle subpaths in menu entries navigation Signed-off-by: alok8bb --- src/components/Container.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Container.tsx b/src/components/Container.tsx index c1f1611..97ac2e7 100644 --- a/src/components/Container.tsx +++ b/src/components/Container.tsx @@ -120,7 +120,9 @@ const Container: React.FC<{ } catch {} }; - const current = MenuEntries.findIndex(([, path]) => location === path); + const current = MenuEntries.findIndex( + ([, path]) => location === path || location.startsWith("${path}" + "/"), + ); const next = get.next(MenuEntries, current)[1]; const prev = get.prev(MenuEntries, current)[1]; const end = current === MenuEntries.length - 1;