Skip to content

Commit

Permalink
Don't call login_info twice on login/logout
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc authored and marcus-oscarsson committed Dec 18, 2024
1 parent 045075a commit 47bab68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
5 changes: 4 additions & 1 deletion ui/src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ function App() {
const loggedIn = useSelector((state) => state.login.loggedIn);

useEffect(() => {
// Fetch login info on mount
dispatch(getLoginInfo()).catch(showBoundary); // eslint-disable-line promise/prefer-await-to-then
}, [dispatch, showBoundary]);

useEffect(() => {
if (loggedIn) {
serverIO.listen();
const refreshInterval = setInterval(sendRefreshSession, REFRESH_INTERVAL);
Expand All @@ -87,7 +90,7 @@ function App() {

// no clean-up required, until we connect to serverIO
return undefined;
}, [loggedIn, dispatch, showBoundary]);
}, [loggedIn]);

if (loggedIn === null) {
// Fetching login info
Expand Down
13 changes: 0 additions & 13 deletions ui/src/requests.js

This file was deleted.

0 comments on commit 47bab68

Please sign in to comment.