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

amp-consent: disable multi consent with flag #14478

Merged
merged 2 commits into from Apr 7, 2018

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Apr 6, 2018

For #13716
Added 'multi-consent' flag to only support single consent instance with v0.


if (!this.isSupportMulti_) {
// Assert single consent instance
user().assert(Object.keys(consents).length <= 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we we just going to honor the first one? Not break?

Copy link
Contributor Author

@zhouyx zhouyx Apr 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right that was the plan. But then I realized it is always safer to throw error. For example, it is always better to throw error if someone ask for three consents to unblock content, rather than unblock content without dealing with the other two.

@@ -90,6 +92,9 @@ export class AmpConsent extends AMP.BaseElement {

/** @private {!Object<string, boolean>} */
this.consentUIPendingMap_ = map();

/** @private {boolean} */
this.isSupportMulti_ = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: isMultiSupported_

@zhouyx zhouyx merged commit aac557e into ampproject:master Apr 7, 2018
glevitzky pushed a commit that referenced this pull request Apr 27, 2018
* multi-consent flag

* address comment, move const out src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants