File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bnc-onboard" ,
3
- "version" : " 1.29.0-0.5.4 " ,
3
+ "version" : " 1.29.0-0.5.5 " ,
4
4
"description" : " Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state." ,
5
5
"keywords" : [
6
6
" ethereum" ,
Original file line number Diff line number Diff line change @@ -50,15 +50,15 @@ function select(
50
50
: desktopDefaultWalletNames
51
51
52
52
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
+ }
53
58
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 ) ) {
62
62
const { walletName, ...initParams } = wallet as WalletInitOptions
63
63
try {
64
64
return getModule ( walletName ) . then ( ( m : any ) =>
@@ -71,15 +71,17 @@ function select(
71
71
throw error
72
72
}
73
73
}
74
+ }
74
75
75
- return Promise . resolve ( wallet )
76
- } )
76
+ // This is a custom wallet module so just return it
77
+ return Promise . resolve ( wallet )
78
+ } )
77
79
)
78
80
}
79
81
80
82
return Promise . all (
81
83
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
83
85
. filter (
84
86
walletName =>
85
87
walletName !== 'detectedwallet' || injectedWalletDetected ( )
You can’t perform that action at this time.
0 commit comments