fix(#fix): landing route fix

keep-around/b214ac7012ef42593bee62c207888a2593bc5a38
Farber Denis 3 years ago
parent 2a0399f695
commit a456195a9b
  1. 4
      src/features/App/index.tsx
  2. 5
      src/helpers/isMatchPage/index.tsx

@ -25,8 +25,8 @@ setClientTitleAndDescription(client.title, client.description)
const Main = () => { const Main = () => {
const { loadingUser, user } = useAuthStore() const { loadingUser, user } = useAuthStore()
if (!user && isMatchPage() && !isMatchPageRFEF() && !window.location.href.includes('1rfef')) return <JoinMatchPage /> if (!user && isMatchPage()) return <JoinMatchPage />
if (!user && isMatchPageRFEF() && !isMatchPage() && window.location.href.includes('1rfef')) return <JoinMatchPageRFEF /> if (!user && isMatchPageRFEF()) return <JoinMatchPageRFEF />
// юзер считывается из localstorage или // юзер считывается из localstorage или
// access_token токен истек и запрашивается новый // access_token токен истек и запрашивается новый

@ -11,8 +11,7 @@ export const isMatchPage = () => {
export const isMatchPageRFEF = () => { export const isMatchPageRFEF = () => {
const splitPath = window.location.pathname.split('/') const splitPath = window.location.pathname.split('/')
const pageType = splitPath[3] const pageType = splitPath[1]
const matchId = toNumber(splitPath[3])
return pageType === 'matches' && !isUndefined(matchId) return pageType === '1rfef'
} }

Loading…
Cancel
Save