Skip to content
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

fix: APP-450 handle undefined errors in buy page when seller is logged in #2536

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -44,17 +44,16 @@ export function OrderSummaryContent({
}: Props) {
const { _ } = useLingui();

const { projectName, currency, pricePerCredit, credits, currencyAmount } =
order;
const { projectName, currency, pricePerCredit, credits } = order;

const displayDenom = useMemo(
() =>
findDisplayDenom({
allowedDenoms,
bankDenom: currency.askDenom,
baseDenom: currency.askBaseDenom,
bankDenom: currency?.askDenom,
baseDenom: currency?.askBaseDenom,
}),
[allowedDenoms, currency.askBaseDenom, currency.askDenom],
[allowedDenoms, currency?.askBaseDenom, currency?.askDenom],
);

return (
Expand Down