From fe15a7fbfd162138f927e6bab6fdd40602ced048 Mon Sep 17 00:00:00 2001
From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it>
Date: Sun, 23 May 2021 15:31:40 +0200
Subject: [PATCH] Avoid continous api call refresh.

---
 src/App.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/App.tsx b/src/App.tsx
index b771948..e5cf11c 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -31,7 +31,7 @@ export const App: FC = () => {
     // Initialize asking the server if this session is already logged in.
     isAuthenticated().then((responseState) => setIsAuth(responseState));
     getRole().then((responseRole) => setRole(responseRole));
-  }, []);
+  }, [isAuth, role]);
 
   return (
     <div data-testid="App">
-- 
GitLab