From 069b4a134a47c385df6b8e70d299377f584c1390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=BCller?= Date: Mon, 26 Feb 2024 09:12:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(app):=20adjust=20start=20but?= =?UTF-8?q?ton=20redirect=20with=20react=20router=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Start.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Start.tsx b/src/components/Start.tsx index 6ac9666..f3c81db 100644 --- a/src/components/Start.tsx +++ b/src/components/Start.tsx @@ -2,7 +2,7 @@ import { Block, Button, Navbar, Page, Popup } from "konsta/react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Link } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import useStore from "../store"; import CollageIcon from "/collage.webp"; @@ -31,6 +31,7 @@ const Collage = () => { function Start() { const { t } = useTranslation(); + const navigate = useNavigate(); const { imageLikeList, resetState } = useStore(); const [discardModalOpen, setDiscardModalOpen] = useState(false); @@ -40,7 +41,7 @@ function Start() { if (isDataAvailable) { setDiscardModalOpen(true); } else { - window.location.href = "/selection"; + navigate("/selection"); } };