@proveanything/smartlinks-auth-ui 0.1.18 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11245,9 +11245,8 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
11245
11245
  const [accountInfo, setAccountInfo] = React.useState(null);
11246
11246
  const [isLoading, setIsLoading] = React.useState(true);
11247
11247
  const callbacksRef = React.useRef(new Set());
11248
- // Initialization guards to prevent race conditions on hot reload
11248
+ // Initialization guard to prevent concurrent runs (NOT persisted across remounts)
11249
11249
  const initializingRef = React.useRef(false);
11250
- const initializedRef = React.useRef(false);
11251
11250
  // Notify all subscribers of auth state changes
11252
11251
  const notifyAuthStateChange = React.useCallback((type, currentUser, currentToken, currentAccountData, currentAccountInfo) => {
11253
11252
  callbacksRef.current.forEach(callback => {
@@ -11267,9 +11266,9 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
11267
11266
  }, []);
11268
11267
  // Initialize auth state - different behavior for proxy mode vs standalone mode
11269
11268
  React.useEffect(() => {
11270
- // Prevent concurrent initialization (race condition fix)
11271
- if (initializingRef.current || initializedRef.current) {
11272
- console.log('[AuthContext] Skipping initialization - already in progress or completed');
11269
+ // Prevent concurrent initialization only
11270
+ if (initializingRef.current) {
11271
+ console.log('[AuthContext] Skipping initialization - already in progress');
11273
11272
  return;
11274
11273
  }
11275
11274
  let isMounted = true;
@@ -11308,7 +11307,6 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
11308
11307
  }
11309
11308
  if (isMounted) {
11310
11309
  setIsLoading(false);
11311
- initializedRef.current = true;
11312
11310
  initializingRef.current = false;
11313
11311
  }
11314
11312
  return;
@@ -11350,7 +11348,6 @@ const AuthProvider = ({ children, proxyMode = false, accountCacheTTL = 5 * 60 *
11350
11348
  finally {
11351
11349
  if (isMounted) {
11352
11350
  setIsLoading(false);
11353
- initializedRef.current = true;
11354
11351
  initializingRef.current = false;
11355
11352
  }
11356
11353
  }