Skip to content

Commit b50b96a

Browse files
committed
Merge branch 'develop' into release/1.31.0
2 parents fa62ca6 + f4cf098 commit b50b96a

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/modules/select/index.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ function select(
5050
: desktopDefaultWalletNames
5151

5252
if (wallets) {
53+
// If we detect an injected wallet then place the detected wallet
54+
// at the beginning of the list e.g. the of the wallet select modal
55+
if (injectedWalletDetected()) {
56+
wallets.unshift({ walletName: 'detectedwallet' })
57+
}
5358
return Promise.all(
54-
wallets
55-
// only include a detected wallet if it's not already one of the provided options
56-
.filter(
57-
wallet =>
58-
isWalletInit(wallet) &&
59-
(wallet.walletName !== 'detectedwallet' || injectedWalletDetected())
60-
)
61-
.map(wallet => {
59+
wallets.map(wallet => {
60+
// If this is a wallet init object then load the built-in wallet module
61+
if (isWalletInit(wallet)) {
6262
const { walletName, ...initParams } = wallet as WalletInitOptions
6363
try {
6464
return getModule(walletName).then((m: any) =>
@@ -71,15 +71,17 @@ function select(
7171
throw error
7272
}
7373
}
74+
}
7475

75-
return Promise.resolve(wallet)
76-
})
76+
// This is a custom wallet module so just return it
77+
return Promise.resolve(wallet)
78+
})
7779
)
7880
}
7981

8082
return Promise.all(
8183
defaultWalletNames
82-
// only include a detected wallet if it's not already one of the provided options
84+
// Include the detected wallet only if an injected wallet is detected
8385
.filter(
8486
walletName =>
8587
walletName !== 'detectedwallet' || injectedWalletDetected()

src/modules/select/wallets/keepkey/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ async function createKeepKeyProvider({
385385
gasPrice,
386386
gasLimit: gas,
387387
to,
388-
value: value || '',
388+
value: value || '0x0',
389389
data: data || '',
390390
chainId: networkId
391391
})

0 commit comments

Comments
 (0)