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-social-share should not layout without a share endpoint #28285

Merged
merged 2 commits into from May 8, 2020

Conversation

caroqliu
Copy link
Contributor

@caroqliu caroqliu commented May 8, 2020

Fixes #28260

@caroqliu caroqliu requested a review from wassgha May 8, 2020 19:13
@@ -125,6 +125,10 @@ class AmpSocialShare extends AMP.BaseElement {

/** @override */
layoutCallback() {
if (!this.shareEndpoint_) {
return Promise.resolve();
Copy link
Contributor

Choose a reason for hiding this comment

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

No user error/warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a comment to this effect -- the endpoint throws an error if it gets far enough to check it in buildCallback. This case handles when buildCallback returns early after the component hides itself, in which case the internal variable is null for not getting to be resolved. A warning is thrown in one of the hiding cases, and I don't think we need to add an error where this case didn't have one before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚨 Error: Cannot read property 'length' of null
5 participants