From ef1c514d43879c497ba226c04fc785894e375ed0 Mon Sep 17 00:00:00 2001 From: mikkojamG Date: Wed, 11 Dec 2024 14:53:36 +0200 Subject: [PATCH] chore: fixing sonar issues HAUKI-672 --- src/components/router/PermissionResolver.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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]);