mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
📝
This commit is contained in:
@ -1,22 +1,19 @@
|
|||||||
// TODO: In case of an embed if localStorage is not available(third party), use localStorage of parent(first party) that contains the iframe.
|
|
||||||
export const localStorage = {
|
export const localStorage = {
|
||||||
getItem(key: string) {
|
getItem(key: string) {
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @calcom/eslint/avoid-web-storage
|
|
||||||
return window.localStorage.getItem(key);
|
return window.localStorage.getItem(key);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// In case storage is restricted. Possible reasons
|
// In case storage is restricted. Possible reasons
|
||||||
// 1. Third Party Context in Chrome Incognito mode.
|
// 1. Chrome/Firefox/... Incognito mode.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setItem(key: string, value: string) {
|
setItem(key: string, value: string) {
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @calcom/eslint/avoid-web-storage
|
|
||||||
window.localStorage.setItem(key, value);
|
window.localStorage.setItem(key, value);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// In case storage is restricted. Possible reasons
|
// In case storage is restricted. Possible reasons
|
||||||
// 1. Third Party Context in Chrome Incognito mode.
|
// 1. Chrome/Firefox/... Incognito mode.
|
||||||
// 2. Storage limit reached
|
// 2. Storage limit reached
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user