Prevent embeds from breaking in Chrome incognito (#814)
This commit is contained in:
parent
7ea6777d6b
commit
8f338a8d88
|
@ -19,6 +19,15 @@ import { useStateCheckEquality } from 'web/hooks/use-state-check-equality'
|
||||||
type AuthUser = undefined | null | UserAndPrivateUser
|
type AuthUser = undefined | null | UserAndPrivateUser
|
||||||
|
|
||||||
const CACHED_USER_KEY = 'CACHED_USER_KEY_V2'
|
const CACHED_USER_KEY = 'CACHED_USER_KEY_V2'
|
||||||
|
// Proxy localStorage in case it's not available (eg in incognito iframe)
|
||||||
|
const localStorage =
|
||||||
|
typeof window !== 'undefined'
|
||||||
|
? window.localStorage
|
||||||
|
: {
|
||||||
|
getItem: () => null,
|
||||||
|
setItem: () => {},
|
||||||
|
removeItem: () => {},
|
||||||
|
}
|
||||||
|
|
||||||
const ensureDeviceToken = () => {
|
const ensureDeviceToken = () => {
|
||||||
let deviceToken = localStorage.getItem('device-token')
|
let deviceToken = localStorage.getItem('device-token')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user