Skip to content

Commit 9630337

Browse files
chore: improve readability
1 parent 03e3354 commit 9630337

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ export function FiatScreenContent(props: {
8787
: undefined,
8888
);
8989

90-
const supportedProviders =
91-
buyWithFiatOptions !== false
92-
? !!buyWithFiatOptions?.supportedProviders?.length &&
93-
(!preferredProvider ||
94-
buyWithFiatOptions.supportedProviders.includes(preferredProvider))
95-
? buyWithFiatOptions?.supportedProviders
96-
: [...FiatProviders]
97-
: [];
90+
const supportedProviders = (() => {
91+
if (!buyWithFiatOptions) return [];
92+
const options = buyWithFiatOptions?.supportedProviders ?? [];
93+
return options.length > 0 &&
94+
(!preferredProvider || options.includes(preferredProvider))
95+
? options
96+
: [...FiatProviders];
97+
})();
9898

9999
const fiatQuoteQuery = useBuyWithFiatQuote(
100100
buyWithFiatOptions !== false && tokenAmount

0 commit comments

Comments
 (0)