Skip to content

Commit

Permalink
nav: fix redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
makinbacon21 committed Nov 20, 2024
1 parent 1938e8c commit b8b1c1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
>
Expand Down Expand Up @@ -163,7 +163,7 @@ export const Navbar = (props: any) => {
href={item.href}
size="lg"
onClick={() => {
cookies.set("pagePref", item.label.toLowerCase());
cookies.set("pagePref", item.href);
}}
>
{item.label}
Expand Down

0 comments on commit b8b1c1b

Please sign in to comment.