Skip to content

Commit

Permalink
fix: APP-450 handle undefined errors in buy page when seller is logge…
Browse files Browse the repository at this point in the history
…d in (#2536)
  • Loading branch information
r41ph authored Nov 28, 2024
1 parent aa05ad6 commit 0854102
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
<span>
<span className="align-top text-[11px] leading-normal">$</span>
<span className={className}>{Number(price).toFixed(2)}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export const AmountWithCurrency = ({
<span className={cn(classes?.amountContainer, 'mr-10')}>
<SupCurrencyAndAmount
price={amount}
currencyCode={currency.askDenom}
currencyCode={currency?.askDenom}
className={classes?.amount}
/>
</span>
<DenomIconWithCurrency
baseDenom={currency.askBaseDenom}
baseDenom={currency?.askBaseDenom}
displayDenom={displayDenom}
className={classes?.denom}
tooltipText={tooltipText}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export function DenomIconWithCurrency({
className,
tooltipText,
}: {
baseDenom: string;
baseDenom: string | undefined;
displayDenom: string;
className?: string;
tooltipText?: string;
}) {
return (
return baseDenom ? (
<Body size="sm" className={cn('flex gap-5', className)}>
<DenomIcon
baseDenom={baseDenom}
Expand All @@ -30,5 +30,5 @@ export function DenomIconWithCurrency({
/>
)}
</Body>
);
) : null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<BuyCreditsSchemaTypes>();
Expand Down Expand Up @@ -132,7 +132,7 @@ export function OrderSummaryContent({
className="pb-[9px]"
/>
<AmountWithCurrency
amount={order.currencyAmount}
amount={currencyAmount}
currency={currency}
displayDenom={displayDenom}
classes={{
Expand Down

0 comments on commit 0854102

Please sign in to comment.