From dbeb24a1290979bdbbb561c8041609290660cbf5 Mon Sep 17 00:00:00 2001 From: Martin Heppner <105971399+martinheppner@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:03:49 +0200 Subject: [PATCH] no city set -> back to search --- src/views/Main/DetailReworked.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/Main/DetailReworked.js b/src/views/Main/DetailReworked.js index 4ea15f6..e92be6a 100644 --- a/src/views/Main/DetailReworked.js +++ b/src/views/Main/DetailReworked.js @@ -114,7 +114,12 @@ const DetailReworked = (props) => { }; const handleCloseTab = () => { - window.close(); + if (!!_city && _city !== "no-city" && !!idOne) { + window.close(); + } + else { + goToSearchPage(); + } }; const navigate = useNavigate(); @@ -123,10 +128,6 @@ const DetailReworked = (props) => { setCityI(_city); }, [_city]); - // const goToStartPage = () => { - // let city = searchParams.get("city"); - // navigate(`/?${!!city ? "city=" + city : ""}`); - // }; const goToSearchPage = () => { !!cityOne && (cityOne !== "no-city") ?