diff --git a/packages/lib/webstorage.ts b/packages/lib/webstorage.ts index a262c190b0..c703bfda05 100644 --- a/packages/lib/webstorage.ts +++ b/packages/lib/webstorage.ts @@ -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. */ @@ -25,4 +25,12 @@ export const localStorage = { return; } }, + removeItem: (key: string) => { + try { + // eslint-disable-next-line @calcom/eslint/avoid-web-storage + window.localStorage.removeItem(key); + } catch (e) { + return; + } + }, };