From a456195a9b7ee7eaba171ce0cb692c9ed135ea66 Mon Sep 17 00:00:00 2001 From: Farber Denis Date: Thu, 25 Aug 2022 09:59:32 +0300 Subject: [PATCH] fix(#fix): landing route fix --- src/features/App/index.tsx | 4 ++-- src/helpers/isMatchPage/index.tsx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/features/App/index.tsx b/src/features/App/index.tsx index 190e4ea6..2c0bdefd 100644 --- a/src/features/App/index.tsx +++ b/src/features/App/index.tsx @@ -25,8 +25,8 @@ setClientTitleAndDescription(client.title, client.description) const Main = () => { const { loadingUser, user } = useAuthStore() - if (!user && isMatchPage() && !isMatchPageRFEF() && !window.location.href.includes('1rfef')) return - if (!user && isMatchPageRFEF() && !isMatchPage() && window.location.href.includes('1rfef')) return + if (!user && isMatchPage()) return + if (!user && isMatchPageRFEF()) return // юзер считывается из localstorage или // access_token токен истек и запрашивается новый diff --git a/src/helpers/isMatchPage/index.tsx b/src/helpers/isMatchPage/index.tsx index 8fd23db0..ba8e3fa0 100644 --- a/src/helpers/isMatchPage/index.tsx +++ b/src/helpers/isMatchPage/index.tsx @@ -11,8 +11,7 @@ export const isMatchPage = () => { export const isMatchPageRFEF = () => { const splitPath = window.location.pathname.split('/') - const pageType = splitPath[3] - const matchId = toNumber(splitPath[3]) + const pageType = splitPath[1] - return pageType === 'matches' && !isUndefined(matchId) + return pageType === '1rfef' }