Skip to content

Instantly share code, notes, and snippets.

@broguinn
Created November 9, 2024 01:50
Show Gist options
  • Save broguinn/95b3cd94142c8f042e58924c86c089f9 to your computer and use it in GitHub Desktop.
Save broguinn/95b3cd94142c8f042e58924c86c089f9 to your computer and use it in GitHub Desktop.
diff --git a/cloud/web/src/components/price-panel/PricePanel.tsx b/cloud/web/src/components/price-panel/PricePanel.tsx
index c94334345..0bedfab0b 100644
--- a/cloud/web/src/components/price-panel/PricePanel.tsx
+++ b/cloud/web/src/components/price-panel/PricePanel.tsx
@@ -23,6 +23,7 @@ export default function PricePanel({
const promoCodeResponse = useQuery({
queryKey: ["getPromoCode", promoCode],
queryFn: () => getPromoCodeData(promoCode),
+ enabled: !!promoCode,
});
const promoCodeApplied =
@@ -228,7 +229,7 @@ const Price = ({
cost: number | undefined;
discount: string | undefined;
}) => {
- const discounted = Number(cost) !== Number(discount);
+ const discounted = discount && Number(cost) !== Number(discount);
const discountString = Math.round(Number(discount)).toLocaleString();
console.log(cost);
console.log(discount);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment