From 7d29222534ce2c16f757e6bafe52423061c628a6 Mon Sep 17 00:00:00 2001 From: Mikola Date: Wed, 20 Dec 2023 19:16:35 +0300 Subject: [PATCH] fixes --- src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx | 5 +---- src/pages/AuctionPage/AuctionPage.tsx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx b/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx index 0b95763..cb528a6 100644 --- a/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx +++ b/src/features/auth/ui/AuthLoginFormUi/AuthLoginFormUi.tsx @@ -1,5 +1,4 @@ import React from "react"; -import { useNavigate } from "react-router-dom"; import { ButtonUi, ButtonUiType } from "../../../../shared/UI/ButtonUi"; @@ -15,8 +14,6 @@ import styles from "./authLoginForm.module.scss"; export const AuthLoginFormUi = () => { - const navigate = useNavigate(); - const schema = yup.object().shape({ username: yup.string() .min(3, 'Минимум 3 символа!') @@ -50,7 +47,7 @@ export const AuthLoginFormUi = () => { } else { setCookie('authToken', res.data!.authToken) setCookie('refreshToken', res.data!.refreshToken) - navigate("/auction") + window.location.replace("/auction") } return res.data as AuthResponsePayload }) diff --git a/src/pages/AuctionPage/AuctionPage.tsx b/src/pages/AuctionPage/AuctionPage.tsx index 2d3e4bb..1525800 100644 --- a/src/pages/AuctionPage/AuctionPage.tsx +++ b/src/pages/AuctionPage/AuctionPage.tsx @@ -91,7 +91,7 @@ export const AuctionPage = () => { setAuctionItems(res.data) setLoader(false) }) - }, [getCookie('authToken')]) + }, []) return (