From acc334f7eefff94775ebc3dfda08aea875600ad9 Mon Sep 17 00:00:00 2001 From: luchunwei Date: Mon, 28 Aug 2023 17:21:07 +0800 Subject: [PATCH] bugfix: operator precedence causes unstable return value Nullish coalescing operator (??) has higher precedence than Conditional (ternary) operator (?) --- packages/ui/src/main.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/ui/src/main.ts b/packages/ui/src/main.ts index 2ca85ba..8b236a0 100644 --- a/packages/ui/src/main.ts +++ b/packages/ui/src/main.ts @@ -75,9 +75,7 @@ export const connect = async ({ ) { const wallet = preAuthorizedWallets.find((w) => w.id === lastWallet?.id) ?? - installedWallets.length === 1 - ? installedWallets[0] - : undefined + (installedWallets.length === 1 ? installedWallets[0] : undefined) if (wallet) { return enableWithVersion(wallet) } // otherwise fallback to modal