From 09461631ec340d9c4118fc72feba5d21f3d4649e Mon Sep 17 00:00:00 2001 From: Tom Quirk <12551741+tomquirk@users.noreply.github.com> Date: Sun, 28 Jan 2024 13:27:07 +1000 Subject: [PATCH] fix: toString bug (#4237) --- .../components/Cart/hooks/useRewardEligibilityCallout.ts | 2 +- .../components/PayProjectCard/components/TokensPerEth.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/v2v3/V2V3Project/ProjectDashboard/components/Cart/hooks/useRewardEligibilityCallout.ts b/src/components/v2v3/V2V3Project/ProjectDashboard/components/Cart/hooks/useRewardEligibilityCallout.ts index 6fb3b9e1fb..07b3c0d114 100644 --- a/src/components/v2v3/V2V3Project/ProjectDashboard/components/Cart/hooks/useRewardEligibilityCallout.ts +++ b/src/components/v2v3/V2V3Project/ProjectDashboard/components/Cart/hooks/useRewardEligibilityCallout.ts @@ -20,7 +20,7 @@ export const useRewardEligibilityCallout = () => { const weiPayAmount = useWeiConverter({ currency: payAmount?.currency, - amount: payAmount?.amount.toString(), + amount: payAmount?.amount?.toString(), }) const eligibleRewards = useMemo(() => { diff --git a/src/components/v2v3/V2V3Project/ProjectDashboard/components/PayProjectCard/components/TokensPerEth.tsx b/src/components/v2v3/V2V3Project/ProjectDashboard/components/PayProjectCard/components/TokensPerEth.tsx index ec79338fa9..6c6708e48c 100644 --- a/src/components/v2v3/V2V3Project/ProjectDashboard/components/PayProjectCard/components/TokensPerEth.tsx +++ b/src/components/v2v3/V2V3Project/ProjectDashboard/components/PayProjectCard/components/TokensPerEth.tsx @@ -8,14 +8,14 @@ export const TokensPerEth = ({ }: { currencyAmount: | { - amount: number + amount: number // NOTE this is actually a `string | undefined` from what I can tell. Too scared to change it atm. currency: V2V3CurrencyOption } | undefined }) => { const { currencyText, receivedTickets, receivedTokenSymbolText } = useTokensPerEth({ - amount: parseFloat(currencyAmount?.amount.toString() || '1'), + amount: parseFloat(currencyAmount?.amount?.toString() || '1'), currency: currencyAmount?.currency || V2V3_CURRENCY_ETH, })