-
Notifications
You must be signed in to change notification settings - Fork 30
Fix choice cards when same product listed twice #13984
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
base: main
Are you sure you want to change the base?
Conversation
Size Change: +83 B (+0.01%) Total Size: 1.04 MB ℹ️ View Unchanged
|
@@ -163,10 +163,14 @@ export const ThreeTierChoiceCards = ({ | |||
({ product, label, benefitsLabel, benefits, pill }) => { | |||
const { supportTier } = product; | |||
|
|||
const selected = | |||
selectedProduct.supportTier === supportTier; | |||
const selected = selectedProduct === product; |
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.
this means we compare both the supportTier and ratePlan
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.
though I've realised this doesn't always work as it's comparing object references! Fix incoming
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.
fix: 1946406
It's technically possible for the epic/banner choice cards to have the same product listed more than once, for different rate plans. If this happens, the component does not distinguish between them and the input ids are the same. This is an issue because:
This PR fixes the product comparison logic, and adds the rate plan to the input ids.
Before:

After:

