MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / handleStorage

Function handleStorage

frontend/src/hooks/useAuthContext.tsx:25–33  ·  view source on GitHub ↗
(e: StorageEvent)

Source from the content-addressed store, hash-verified

23
24 useEffect(() => {
25 const handleStorage = (e: StorageEvent) => {
26 if (e.key === GUEST_MODE_KEY || e.key === ACCESS_TOKEN_KEY) {
27 setIsGuest(localStorage.getItem(GUEST_MODE_KEY) === 'true')
28 setIsLoggedIn(
29 Boolean(localStorage.getItem(ACCESS_TOKEN_KEY)) ||
30 localStorage.getItem(GUEST_MODE_KEY) === 'true',
31 )
32 }
33 }
34 window.addEventListener('storage', handleStorage)
35 return () => window.removeEventListener('storage', handleStorage)
36 }, [])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected