From 723d1775b0a0e8901bf7d6b6d137d565e59851ee Mon Sep 17 00:00:00 2001 From: gloginov Date: Thu, 10 Oct 2024 10:18:17 +0500 Subject: [PATCH] [SOK-32] *remove timeout for redirects --- .../client/src/components/hoc/withAuthUser.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/client/src/components/hoc/withAuthUser.tsx b/packages/client/src/components/hoc/withAuthUser.tsx index ca8928a..a92027e 100644 --- a/packages/client/src/components/hoc/withAuthUser.tsx +++ b/packages/client/src/components/hoc/withAuthUser.tsx @@ -25,12 +25,8 @@ export default function withAuthUser

( const { pathname } = location const successAuth = (redirectTo: string) => { - toast.success('Вы уже авторизованы', { - autoClose: 1500, - onClose: () => { - navigate(redirectTo) - }, - }) + toast.success('Вы уже авторизованы') + navigate(redirectTo) } useEffect(() => { @@ -49,12 +45,8 @@ export default function withAuthUser

( window.sessionStorage.setItem('userIsLogged', '0') // 1 if (!['/sign-in', '/sign-up'].includes(pathname)) { - toast.error('Необходимо авторизоваться', { - autoClose: 1500, - onClose: () => { - navigate('/sign-in') - }, - }) + toast.error('Необходимо авторизоваться') + navigate('/sign-in') } }) } else if (redirectTo) {