Fleet Desktop Device User Page: Remove unnecessary API call (#6427)

This commit is contained in:
RachelElysia
2022-06-30 10:42:41 -04:00
committed by GitHub
parent 3c648d6925
commit 9367464d20
2 changed files with 4 additions and 2 deletions
@@ -0,0 +1 @@
* Remove unnecessary call to enroll secret API on device user page when logged in
+3 -2
View File
@@ -84,7 +84,7 @@ const App = ({ children, location, router }: IAppProps): JSX.Element => {
};
useEffect(() => {
if (authToken()) {
if (authToken() && !location?.pathname.includes("/device/")) {
fetchCurrentUser();
}
}, [location?.pathname]);
@@ -97,7 +97,8 @@ const App = ({ children, location, router }: IAppProps): JSX.Element => {
typeof isOnlyObserver !== "undefined" &&
!isOnlyObserver &&
typeof isAnyTeamMaintainerOrTeamAdmin !== "undefined" &&
!isAnyTeamMaintainerOrTeamAdmin;
!isAnyTeamMaintainerOrTeamAdmin &&
!location?.pathname.includes("/device/");
const getEnrollSecret = async () => {
try {