Correcting some bugs in statistics.

This commit is contained in:
charles-gauthereau
2025-02-13 19:20:55 +01:00
parent 7a59c616eb
commit 8586abf7e5
8 changed files with 81 additions and 33 deletions
+20 -8
View File
@@ -1,14 +1,26 @@
"use client"
import {useRouter} from "next/navigation";
import {redirect, useRouter} from "next/navigation";
import {useEffect} from "react";
import {currentUser} from "@/auth/current-user";
export default function NotFound() {
// export default function NotFound() {
//
// const router = useRouter();
//
// useEffect(() => {
// router.push('/');
// }, [router]);
//
// return null; // You can return null or a loading spinner while the redirect happens
// }
const router = useRouter();
export default async function NotFound() {
useEffect(() => {
router.push('/');
}, [router]);
// const user = await currentUser()
// if (!user) {
// redirect("/")
// }else{
// redirect("/")
// }
return null; // You can return null or a loading spinner while the redirect happens
redirect("/")
}