mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 09:42:13 +00:00
fix comparison between null and undefined
This commit is contained in:
parent
2c6c2adb74
commit
d89bd42220
1 changed files with 3 additions and 3 deletions
|
|
@ -7,12 +7,12 @@ const { useProfile } = require('stremio/common');
|
|||
const withProtectedRoutes = (Component) => {
|
||||
return function withProtectedRoutes(props) {
|
||||
const profile = useProfile();
|
||||
const previousProfileRef = React.useRef(null);
|
||||
const previousAuthRef = React.useRef(profile.auth);
|
||||
React.useEffect(() => {
|
||||
if (previousProfileRef.current?.auth !== null && profile.auth === null) {
|
||||
if (previousAuthRef.current !== null && profile.auth === null) {
|
||||
window.location = '#/intro';
|
||||
}
|
||||
previousProfileRef.current = profile;
|
||||
previousAuthRef.current = profile.auth;
|
||||
}, [profile]);
|
||||
const onRouteChange = React.useCallback((routeConfig) => {
|
||||
if (profile.auth !== null && routeConfig.component === Intro) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue