From 08541023c0dac90b2633b1f0f3d037a8a2ae8901 Mon Sep 17 00:00:00 2001 From: r41ph Date: Thu, 28 Nov 2024 09:10:19 +0000 Subject: [PATCH] fix: APP-450 handle undefined errors in buy page when seller is logged in (#2536) --- .../SupCurrencyAndAmount/SupCurrencyAndAmount.tsx | 4 ++-- .../molecules/AmountWithCurrency/AmountWithCurrency.tsx | 4 ++-- .../DenomIconWithCurrency/DenomIconWithCurrency.tsx | 6 +++--- .../OrderSummaryCard/OrderSummaryCard.Content.tsx | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/web-components/src/components/SupCurrencyAndAmount/SupCurrencyAndAmount.tsx b/web-components/src/components/SupCurrencyAndAmount/SupCurrencyAndAmount.tsx index 4ee6a63d0c..a906cf8598 100644 --- a/web-components/src/components/SupCurrencyAndAmount/SupCurrencyAndAmount.tsx +++ b/web-components/src/components/SupCurrencyAndAmount/SupCurrencyAndAmount.tsx @@ -6,10 +6,10 @@ export function SupCurrencyAndAmount({ className = '', }: { price: number | string; - currencyCode: string; + currencyCode: string | undefined; className?: string; }) { - return currencyCode === USD_DENOM ? ( + return currencyCode && currencyCode === USD_DENOM ? ( $ {Number(price).toFixed(2)} diff --git a/web-marketplace/src/components/molecules/AmountWithCurrency/AmountWithCurrency.tsx b/web-marketplace/src/components/molecules/AmountWithCurrency/AmountWithCurrency.tsx index 2dd5c1be10..a12a6780ac 100644 --- a/web-marketplace/src/components/molecules/AmountWithCurrency/AmountWithCurrency.tsx +++ b/web-marketplace/src/components/molecules/AmountWithCurrency/AmountWithCurrency.tsx @@ -27,12 +27,12 @@ export const AmountWithCurrency = ({ )} - ); + ) : null; } diff --git a/web-marketplace/src/components/molecules/OrderSummaryCard/OrderSummaryCard.Content.tsx b/web-marketplace/src/components/molecules/OrderSummaryCard/OrderSummaryCard.Content.tsx index 7f17ce3bca..4b5e035806 100644 --- a/web-marketplace/src/components/molecules/OrderSummaryCard/OrderSummaryCard.Content.tsx +++ b/web-marketplace/src/components/molecules/OrderSummaryCard/OrderSummaryCard.Content.tsx @@ -55,10 +55,10 @@ export function OrderSummaryContent({ () => findDisplayDenom({ allowedDenoms, - bankDenom: currency.askDenom, - baseDenom: currency.askBaseDenom, + bankDenom: currency?.askDenom, + baseDenom: currency?.askBaseDenom, }), - [allowedDenoms, currency.askBaseDenom, currency.askDenom], + [allowedDenoms, currency?.askBaseDenom, currency?.askDenom], ); const { activeStep } = useMultiStep(); @@ -132,7 +132,7 @@ export function OrderSummaryContent({ className="pb-[9px]" />