From f3468f40d1f06a5cedfd0c83591b7e74eaf3f014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=A0s?= Date: Mon, 22 May 2023 14:59:45 +0200 Subject: [PATCH] Add LoadingPage in Graphique during auth Took 2 minutes --- src/pages/graphique.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/graphique.tsx b/src/pages/graphique.tsx index 0678a54..d894451 100644 --- a/src/pages/graphique.tsx +++ b/src/pages/graphique.tsx @@ -11,9 +11,12 @@ import { useRef, useEffect } from "react"; import { useSession } from "next-auth/react"; import type { Session } from "@/models/auth/Session"; import { Role } from "@prisma/client"; +import LoadingPage from '@/components/LoadingPage'; export default function Graphique() { const { data: session, status } = useSession({ required: true }); + if (status === 'loading') return + const { user } = session as unknown as Session; return ( <>