jbilcke-hf HF staff commited on
Commit
70b0c73
1 Parent(s): faf4681

remove infinite loop

Browse files
Files changed (1) hide show
  1. src/app/state/useCurrentUser.ts +2 -1
src/app/state/useCurrentUser.ts CHANGED
@@ -92,7 +92,7 @@ export function useCurrentUser({
92
  // (depending on if it's a secret page or not)
93
 
94
  if (isLoginRequired) {
95
- await login("/")
96
  }
97
 
98
  return undefined
@@ -141,6 +141,7 @@ export function useCurrentUser({
141
  // already logged-in, no need to spend an API call
142
  // although it is worth noting that the API token might be expired at this stage
143
  if (userId) {
 
144
  return
145
  }
146
 
 
92
  // (depending on if it's a secret page or not)
93
 
94
  if (isLoginRequired) {
95
+ // await login("/")
96
  }
97
 
98
  return undefined
 
141
  // already logged-in, no need to spend an API call
142
  // although it is worth noting that the API token might be expired at this stage
143
  if (userId) {
144
+ console.log("we are already logged-in")
145
  return
146
  }
147