From 7904a12d264fc3ad48818c501872cc3789da6827 Mon Sep 17 00:00:00 2001 From: Thomas Makin Date: Wed, 20 Nov 2024 11:21:06 -0500 Subject: [PATCH] nav: fix redirection --- app/page.tsx | 6 ++---- components/navbar.tsx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 0836a47..e13e2d6 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -73,10 +73,8 @@ export default async function Page(props: { }) { const cookieStore = await cookies(); const pagePref = cookieStore.get("pagePref"); - if (pagePref && pagePref.value != "plan") { - console.log("wtf"); - console.log(pagePref.value); - redirect("/" + pagePref.value); + if (pagePref && pagePref.value != "/") { + redirect(pagePref.value); } const searchParams = await props.searchParams; diff --git a/components/navbar.tsx b/components/navbar.tsx index e86dacb..f0d2607 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -96,7 +96,7 @@ export const Navbar = (props: any) => { variant: pathname === item.href ? "shadow" : "ghost", })} onClick={() => { - cookies.set("pagePref", item.label.toLowerCase()); + cookies.set("pagePref", item.href); }} href={item.href} >