From 11800ee2bebcf91a4599485ecb379773764682d8 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Sun, 14 May 2023 00:18:57 +0200 Subject: [PATCH] fix: bad redirect in case of resistant not found --- src/routes/PageResistant.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/PageResistant.tsx b/src/routes/PageResistant.tsx index 2f00fbe..7bf1efa 100644 --- a/src/routes/PageResistant.tsx +++ b/src/routes/PageResistant.tsx @@ -1,4 +1,4 @@ -import { redirect, useNavigate, useParams } from "react-router"; +import { useNavigate, useParams } from "react-router"; import { getResistantPhotoUrl } from "../getResistantPhotoUrl"; import { resistants } from "../resistants"; import { getResistantsPageUrl } from "../getResistantsPageUrl"; @@ -10,7 +10,7 @@ export const PageResistant = () => { const resistant = resistants.find((r) => r.id === idResistant); if (!resistant) { - redirect(getResistantsPageUrl()); + window.location.assign(getResistantsPageUrl()); return <>RĂ©sistant introuvable; }