Skip to content

Commit e2c6d5c

Browse files
Address PR Comments
1 parent c93fa27 commit e2c6d5c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/cookieSyncManager.interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface ICookieSyncManager {
66
attemptCookieSync: (
77
previousMPID: MPID,
88
mpid: MPID,
9-
mpidIsNotInCookies: boolean
9+
mpidIsNotInCookies?: boolean
1010
) => void;
1111
performCookieSync: (
1212
url: string,

src/cookieSyncManager.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function CookieSyncManager(
3838
this.attemptCookieSync = (
3939
previousMPID: MPID,
4040
mpid: MPID,
41-
mpidIsNotInCookies: boolean
41+
mpidIsNotInCookies?: boolean
4242
): void => {
4343
if (!mpid || mpInstance._Store.webviewBridgeEnabled) {
4444
return;
@@ -151,16 +151,10 @@ export default function CookieSyncManager(
151151
// if MPID is new to cookies, we should not try to perform the cookie sync
152152
// because a cookie sync can only occur once a user either consents or doesn't
153153
// we should not check if its enabled if the user has a blank consent
154-
// TODO: We should do this check outside of this function
155154
if (requiresConsent && mpidIsNotInCookies) {
156155
return;
157156
}
158157

159-
// TODO: Refactor so that check is made outside of the function.
160-
// Cache or store the boolean so that it only gets called once per
161-
// cookie sync attempt per module.
162-
// Currently, attemptCookieSync is called as a loop and therefore this
163-
// function polls the user object and consent multiple times.
164158
if (
165159
// https://go.mparticle.com/work/SQDSDKS-5009
166160
mpInstance._Consent.isEnabledForUserConsent(

0 commit comments

Comments
 (0)