Skip to content

Commit

Permalink
bugfix: operator precedence causes unstable return value
Browse files Browse the repository at this point in the history
Nullish coalescing operator (??) has higher precedence than Conditional (ternary) operator  (?)
  • Loading branch information
chunwei authored and avimak committed Aug 29, 2023
1 parent 5e20094 commit acc334f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acc334f

Please sign in to comment.