Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOB 8960 #415

Merged
merged 11 commits into from
Jul 11, 2024
3 changes: 0 additions & 3 deletions src/anonymousUserTracking/anonymousUserEventManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
ENDPOINT_TRACK_ANON_SESSION,
WEB_PLATFORM,
KEY_PREFER_USERID,
SHARED_PREF_MATCHED_CRITERIAS,
ENDPOINTS
} from 'src/constants';
import { baseIterableRequest } from 'src/request';
Expand Down Expand Up @@ -84,7 +83,7 @@
JSON.stringify(outputObject)
);
} catch (error) {
console.error('Error updating anonymous session:', error);

Check warning on line 86 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
}

Expand All @@ -96,7 +95,7 @@
validation: {}
})
.then((response) => {
const criteriaData: any = response.data;

Check warning on line 98 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
if (criteriaData) {
localStorage.setItem(
SHARED_PREFS_CRITERIA,
Expand All @@ -105,7 +104,7 @@
}
})
.catch((e) => {
console.log('response', e);

Check warning on line 107 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
});
}

Expand Down Expand Up @@ -160,7 +159,7 @@
return checker.getMatchedCriteria(criteriaData);
}
} catch (error) {
console.error('checkCriteriaCompletion', error);

Check warning on line 162 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}

return null;
Expand Down Expand Up @@ -219,9 +218,8 @@
: [];

if (trackEventList.length) {
trackEventList.forEach((event: any) => {

Check warning on line 221 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
const eventType = event[SHARED_PREFS_EVENT_TYPE];
delete event.criteriaId;
delete event.eventType;
switch (eventType) {
case TRACK_EVENT: {
Expand Down Expand Up @@ -251,11 +249,10 @@
removeAnonSessionCriteriaData() {
localStorage.removeItem(SHARED_PREFS_ANON_SESSIONS);
localStorage.removeItem(SHARED_PREFS_EVENT_LIST_KEY);
localStorage.removeItem(SHARED_PREF_MATCHED_CRITERIAS);
}

private async storeEventListToLocalStorage(
newDataObject: Record<any, any>,

Check warning on line 255 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type

Check warning on line 255 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
shouldOverWrite: boolean
) {
const strTrackEventList = localStorage.getItem(SHARED_PREFS_EVENT_LIST_KEY);
Expand All @@ -268,7 +265,7 @@
if (shouldOverWrite) {
const trackingType = newDataObject[SHARED_PREFS_EVENT_TYPE];
const indexToUpdate = previousDataArray.findIndex(
(obj: any) => obj[SHARED_PREFS_EVENT_TYPE] === trackingType

Check warning on line 268 in src/anonymousUserTracking/anonymousUserEventManager.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
);
if (indexToUpdate !== -1) {
const dataToUpdate = previousDataArray[indexToUpdate];
Expand Down
Loading