Add removeItem to webstorage
This commit is contained in:
parent
a57085cf64
commit
412f15814e
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Provides a wrapper around localStorage to avoid errors in case of restricted storage access.
|
* Provides a wrapper around localStorage(and sessionStorage(TODO when needed)) to avoid errors in case of restricted storage access.
|
||||||
*
|
*
|
||||||
* TODO: In case of an embed if localStorage is not available(third party), use localStorage of parent(first party) that contains the iframe.
|
* TODO: In case of an embed if localStorage is not available(third party), use localStorage of parent(first party) that contains the iframe.
|
||||||
*/
|
*/
|
||||||
|
@ -25,4 +25,12 @@ export const localStorage = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
removeItem: (key: string) => {
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line @calcom/eslint/avoid-web-storage
|
||||||
|
window.localStorage.removeItem(key);
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user