()
| 11 | // For users that haven't changed their session cookies recently, |
| 12 | // we also can check for the browser-set `preferred_color_mode` cookie. |
| 13 | export function useHasAccount() { |
| 14 | const [hasAccount, setHasAccount] = useState<boolean | null>(null) |
| 15 | |
| 16 | useEffect(() => { |
| 17 | const cookieValue = Cookies.get('color_mode') |
| 18 | const altCookieValue = Cookies.get('preferred_color_mode') |
| 19 | setHasAccount(Boolean(cookieValue || altCookieValue)) |
| 20 | }, []) |
| 21 | |
| 22 | return { hasAccount } |
| 23 | } |