From 0c6bc436a40cbbc8276477b917be544e712686f4 Mon Sep 17 00:00:00 2001 From: imohammedhamed Date: Tue, 28 Jan 2025 03:23:09 +0200 Subject: [PATCH] Change The router.push To redirect --- components/dashboard-components/AppSidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dashboard-components/AppSidebar.tsx b/components/dashboard-components/AppSidebar.tsx index a641be72..4c8c8872 100644 --- a/components/dashboard-components/AppSidebar.tsx +++ b/components/dashboard-components/AppSidebar.tsx @@ -16,7 +16,7 @@ import { import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu" import { useMutation, useQuery } from "convex/react"; import { api } from "@/convex/_generated/api"; -import { useRouter } from "next/navigation"; +import { redirect, useRouter } from "next/navigation"; import WorkingSpaceSettings from "./WorkingSpaceSettings"; import { Avatar, AvatarFallback, AvatarImage } from "@radix-ui/react-avatar"; import { useAuthActions } from "@convex-dev/auth/react"; @@ -53,7 +53,7 @@ export default function AppSidebar() { setLoading(true); try { await signOut(); - router.push("/"); + redirect("/") } catch (error) { console.error(error); } finally {