Skip to content

Commit

Permalink
fix(fscomponents): fix price/originalPrice comparison
Browse files Browse the repository at this point in the history
The price and originalPrice objects were being compared rather than comparing their values.

BREAKING CHANGE: Under the default render behavior, originalPrice will no longer be displayed unless
it is actually different from price.
  • Loading branch information
nathan-sankbeil committed Aug 20, 2019
1 parent 82c9813 commit 0f9447f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ProductItemPrice extends Component<ProductItemPriceProps> {
return null;
}

if (originalPrice && originalPrice !== price) {
if (originalPrice && !originalPrice.value.equals(price.value)) {
return (
<View style={[style.priceContainer]}>
<Text style={[types.small, weights.regular, style.originalPrice, originalPriceStyle]}>
Expand Down

0 comments on commit 0f9447f

Please sign in to comment.