fix(#hot-fix): disabled watching for virtual user

pull/281/head
Rakov 2 years ago
parent 9f0c779246
commit 0b2c38871a
  1. 9
      src/features/AuthStore/hooks/useAuth.tsx

@ -23,6 +23,7 @@ import {
readToken, readToken,
setCookie, setCookie,
removeCookie, removeCookie,
isMatchPage,
} from 'helpers' } from 'helpers'
import { import {
@ -282,6 +283,14 @@ export const useAuth = () => {
readToken() && fetchUserInfo() readToken() && fetchUserInfo()
}, [fetchUserInfo, user]) }, [fetchUserInfo, user])
// временно отрубили возможность смотреть матчи вирт. юзерам
// в связи с переездом бэка
useEffect(() => {
if (userInfo && isMatchPage() && +userInfo.email < 0) {
logout()
}
}, [logout, userInfo])
const auth = useMemo(() => ({ const auth = useMemo(() => ({
fetchUserInfo, fetchUserInfo,
isFromLanding, isFromLanding,

Loading…
Cancel
Save