Skip to content

Commit 85fa7f8

Browse files
authored
fix:session storage check (#169)
* Fix session storage availability check * Rename func name for clarity
1 parent 8326540 commit 85fa7f8

File tree

1 file changed

+3
-3
lines changed
  • packages/experiment-browser/src/integration

1 file changed

+3
-3
lines changed

packages/experiment-browser/src/integration/manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ export class IntegrationManager {
125125

126126
export class SessionDedupeCache {
127127
private readonly storageKey: string;
128-
private readonly isSessionStorageAvailable = isSessionStorageAvailable();
128+
private readonly isSessionStorageAvailable = checkIsSessionStorageAvailable();
129129
private inMemoryCache: Record<string, Exposure> = {};
130130

131131
constructor(instanceName: string) {
132132
this.storageKey = `EXP_sent_v2_${instanceName}`;
133133
// Remove previous version of storage if it exists.
134-
if (isSessionStorageAvailable) {
134+
if (this.isSessionStorageAvailable) {
135135
safeGlobal.sessionStorage.removeItem(`EXP_sent_${instanceName}`);
136136
}
137137
}
@@ -239,7 +239,7 @@ export class PersistentTrackingQueue {
239239
}
240240
}
241241

242-
const isSessionStorageAvailable = (): boolean => {
242+
const checkIsSessionStorageAvailable = (): boolean => {
243243
const globalScope = getGlobalScope();
244244
if (globalScope) {
245245
try {

0 commit comments

Comments
 (0)