diff --git a/src/components/router/PermissionResolver.tsx b/src/components/router/PermissionResolver.tsx index 86c86fee..7519bc1f 100644 --- a/src/components/router/PermissionResolver.tsx +++ b/src/components/router/PermissionResolver.tsx @@ -15,18 +15,18 @@ const PermissionResolver = ({ const { pathname, search } = useLocation(); const navigate = useNavigate(); const isAuthenticated = !!authTokens; - const [isLoading, setLoading] = useState(true); + const [isLoading, setIsLoading] = useState(true); const [isAuthorized, setIsAuthorized] = useState(false); useEffect(() => { if (!id || !isAuthenticated) { - setLoading(false); + setIsLoading(false); } else { api .testResourcePostPermission(id) .then((hasPermission: boolean) => { setIsAuthorized(hasPermission); - setLoading(false); + setIsLoading(false); }) .catch((e) => { if (clearAuth) { @@ -35,7 +35,7 @@ const PermissionResolver = ({ if (e.response?.status === 404) { return navigate(`/not_found?original_request=${pathname}${search}`); } - return setLoading(false); + return setIsLoading(false); }); } }, [clearAuth, navigate, id, isAuthenticated, pathname, search]);