-
Notifications
You must be signed in to change notification settings - Fork 4
fix:send default and update consent payloads on kit init #51
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
fix:send default and update consent payloads on kit init #51
Conversation
src/common.js
Outdated
// so we shouldn't send an update. | ||
if (this.consentPayloadAsString && this.consentMappings) { | ||
|
||
if (!this.isEmpty(consentState)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can probably move this to the if statement at 150 to avoid unnecessary nested if statements
src/initialization.js
Outdated
common.consentHandler.generateConsentStatePayloadFromMappings( | ||
updatedConsentState, | ||
common.consentMappings | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this can become one var
and then comma separated instead of having 3 vars for each, let me know if this is preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved it back to 3 vars instead of comma separated per meeting with @alexs-mparticle
src/initialization.js
Outdated
updatedDefaultConsentPayload | ||
); | ||
|
||
common.sendConsent('default', updatedDefaultConsentPayload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can probably make a function in common for lines 82-86 and 88-92 and call it here instead of having the same repeated lines of code since they're doing the same actions just with two different variables
Summary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)