fix(#ott2714): min fix

keep-around/b214ac7012ef42593bee62c207888a2593bc5a38
Farber Denis 3 years ago
parent 70849e0aba
commit 3d1bd8af4f
  1. 6
      src/features/App/index.tsx
  2. 7
      src/features/AuthStore/hooks/useAuth.tsx
  3. 8
      src/helpers/isMatchPage/index.tsx

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

@ -18,7 +18,7 @@ import {
} from 'helpers/languageUrlParam'
import { writeToken, removeToken } from 'helpers/token'
import { setCookie, removeCookie } from 'helpers/cookie'
import { isMatchPage } from 'helpers/isMatchPage'
import { isMatchPage, isMatchPageRFEF } from 'helpers/isMatchPage'
import { useLocalStore, useToggle } from 'hooks'
@ -124,9 +124,12 @@ export const useAuth = () => {
signinRedirectCallback()
} else {
checkUser().catch(() => {
if (!isMatchPage()) {
if (!isMatchPage() && !isMatchPageRFEF()) {
login()
}
// if (!isMatchPageRFEF()) {
// login()
// }
if (history.location.pathname === '/') {
setSearch(history.location.search)
}

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

Loading…
Cancel
Save