From e113daf6f1e9374b4c2deae2780c6490a8b96f77 Mon Sep 17 00:00:00 2001 From: Mikkel RINGAUD Date: Thu, 14 Mar 2024 14:59:34 +0100 Subject: [PATCH] fix(web): navigate when no data --- packages/website/src/routes/index.tsx | 121 +++++++++++++------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/packages/website/src/routes/index.tsx b/packages/website/src/routes/index.tsx index 27d9897..1a13355 100644 --- a/packages/website/src/routes/index.tsx +++ b/packages/website/src/routes/index.tsx @@ -1,5 +1,5 @@ import { onMount, Show, For, createSignal } from "solid-js"; -import { useNavigate } from "@solidjs/router"; +import { Navigate } from "@solidjs/router"; import { setStore, store } from "../store"; import { createDump } from "../client/dump"; import Semester from "../components/Semester"; @@ -10,8 +10,6 @@ import { SafeStorage } from "../utils/safeStorage"; import toast from "solid-toast"; export default function Home() { - const navigate = useNavigate(); - /** `null` when not selected yet. */ const [_selectedSemester, _setSelectedSemester] = createSignal(SafeStorage.getItem("selectedSemester")); /** Helper function that also stores in the localStorage to keep preference on reload. */ @@ -37,7 +35,6 @@ export default function Home() { if (dump.status === 403) { await clearUserData(false); - navigate("/authenticate"); return; } else if (dump.status !== 200) { @@ -58,66 +55,68 @@ export default function Home() { }) return ( - - Récupération des données...
- Étudiant en {dump().className} -
+ Étudiant en {dump().className} +