Skip to content

Commit

Permalink
fix: check if method is provided before condition
Browse files Browse the repository at this point in the history
  • Loading branch information
aramalipoor committed Dec 11, 2022
1 parent 9dc1d42 commit 6d879d2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const TieredSalesPayButton = ({
/>
</div>
</>
) : ['utrust', 'bitpay', 'coinbase'].find(method.includes) ? (
) : method?.includes &&
['utrust', 'bitpay', 'coinbase'].find(method.includes) ? (
<>
<span>Buy with other Crypto</span>
<div>
Expand All @@ -51,9 +52,9 @@ export const TieredSalesPayButton = ({
));

const rampDisabled =
(method.includes('stripe') && !rampConfig?.stripeEnabled) ||
(method.includes('utrust') && !rampConfig?.utrustEnabled) ||
(method.includes('bitpay') && !rampConfig?.bitpayEnabled);
(method?.includes?.('stripe') && !rampConfig?.stripeEnabled) ||
(method?.includes?.('utrust') && !rampConfig?.utrustEnabled) ||
(method?.includes?.('bitpay') && !rampConfig?.bitpayEnabled);

if (!alwaysShow) {
if (rampDisabled) {
Expand Down

0 comments on commit 6d879d2

Please sign in to comment.