File tree Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ function derivationSelectHtmlString(walletName: string) {
40
40
function derivationPath ( ) {
41
41
let completed = false
42
42
let showCustomInput = false
43
- let path = ''
43
+ let path : string | undefined
44
44
45
45
return ( stateAndHelpers : StateAndHelpers ) : WalletCheckModal | undefined => {
46
46
const { wallet, address } = stateAndHelpers
@@ -57,17 +57,21 @@ function derivationPath() {
57
57
const pathIndex = ( document as any ) . getElementById ( 'derivation-select' )
58
58
. selectedIndex
59
59
60
- const path = derivationPaths [ wallet . name ] [ pathIndex ] . path
60
+ const selectedPath = derivationPaths [ wallet . name ] [ pathIndex ] . path
61
61
62
- if ( ! path ) {
62
+ if ( ! selectedPath ) {
63
63
showCustomInput = true
64
+ } else {
65
+ path = selectedPath
64
66
}
65
67
}
66
68
67
69
const deleteWindowProperties = ( ) => {
68
70
delete ( window as any ) . handleCustomInput
71
+ delete ( window as any ) . handleDerivationSelect
69
72
}
70
73
; ( window as any ) . handleCustomInput = handleCustomInput
74
+ ; ( window as any ) . handleDerivationSelect = handleDerivationSelect
71
75
72
76
return {
73
77
heading : 'Hardware Wallet Connect' ,
@@ -81,6 +85,9 @@ function derivationPath() {
81
85
onclick : ( ) => {
82
86
wallet . connect &&
83
87
wallet . connect ( ) . then ( ( ) => {
88
+ wallet . provider . setPath (
89
+ path || derivationPaths [ wallet . name ] [ 0 ] . path
90
+ )
84
91
deleteWindowProperties ( )
85
92
completed = true
86
93
} )
Original file line number Diff line number Diff line change 64
64
65
65
const currentWallet = get (wallet ).name
66
66
67
- // check if the current wallet is ledger
68
- if (currentWallet === ' Ledger' ) {
69
- // if loadingAccounts module isn't already loaded, then load it
70
- if (! modules .find (module => module .id === ' loadingAccounts' )) {
71
- // import the loading accounts module
72
- const { default : loadingAccountsModule } = await import (
73
- ' ../modules/check/loading-accounts'
74
- )
75
-
76
- // initialize the loading accounts module and put at the front of the modules array
77
- modules .unshift (loadingAccountsModule ())
78
- }
79
- } else {
80
- // not a ledger wallet, so make sure loadingAccounts module is not in array
81
- modules = modules .filter (m => m .id !== ' loadingAccounts' )
82
- }
83
-
84
67
// loop through and run each module to check if a modal needs to be shown
85
68
runModules (modules ).then (
86
69
(result : {
You can’t perform that action at this time.
0 commit comments