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

fix(messenger): allow buttonless card #579

Merged
merged 1 commit into from
May 1, 2023
Merged

Conversation

davidvitora
Copy link
Contributor

Today it's impossible to have a card without a button; this PR fixes it. I believe that before, it was not allowed because you can't send an empty button list, if you do, the card is not displayed on Messenger; my PR will make sure that there is at least one button before creating the property.

@davidvitora davidvitora requested a review from a team as a code owner April 6, 2023 19:23
@@ -30,7 +30,7 @@ export interface MessengerCard {
title: string
image_url?: string
subtitle?: string
buttons: MessengerButton[]
buttons?: MessengerButton[]
Copy link
Member

Choose a reason for hiding this comment

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

non-blocking: making this prop optional will force you to always check if its defined everywhere. IMO you should leave this non optional and make it an empty array whenever you construct the object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@EFF Empty arrays will actually break messenger :( , I believe that is why there was a push on line 48 before

@davidvitora davidvitora merged commit adb389a into master May 1, 2023
@davidvitora davidvitora deleted the dv_fix_facebook_button branch May 1, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants