(e: StorageEvent)
| 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 | }, []) |
nothing calls this directly
no outgoing calls
no test coverage detected