Skip to content

Commit 7094f0c

Browse files
committed
Progress
1 parent 6069287 commit 7094f0c

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

src/modules/check/derivation-path.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function derivationSelectHtmlString(walletName: string) {
4040
function derivationPath() {
4141
let completed = false
4242
let showCustomInput = false
43-
let path = ''
43+
let path: string | undefined
4444

4545
return (stateAndHelpers: StateAndHelpers): WalletCheckModal | undefined => {
4646
const { wallet, address } = stateAndHelpers
@@ -57,17 +57,21 @@ function derivationPath() {
5757
const pathIndex = (document as any).getElementById('derivation-select')
5858
.selectedIndex
5959

60-
const path = derivationPaths[wallet.name][pathIndex].path
60+
const selectedPath = derivationPaths[wallet.name][pathIndex].path
6161

62-
if (!path) {
62+
if (!selectedPath) {
6363
showCustomInput = true
64+
} else {
65+
path = selectedPath
6466
}
6567
}
6668

6769
const deleteWindowProperties = () => {
6870
delete (window as any).handleCustomInput
71+
delete (window as any).handleDerivationSelect
6972
}
7073
;(window as any).handleCustomInput = handleCustomInput
74+
;(window as any).handleDerivationSelect = handleDerivationSelect
7175

7276
return {
7377
heading: 'Hardware Wallet Connect',
@@ -81,6 +85,9 @@ function derivationPath() {
8185
onclick: () => {
8286
wallet.connect &&
8387
wallet.connect().then(() => {
88+
wallet.provider.setPath(
89+
path || derivationPaths[wallet.name][0].path
90+
)
8491
deleteWindowProperties()
8592
completed = true
8693
})

src/views/WalletCheck.svelte

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,6 @@
6464
6565
const currentWallet = get(wallet).name
6666
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-
8467
// loop through and run each module to check if a modal needs to be shown
8568
runModules(modules).then(
8669
(result: {

0 commit comments

Comments
 (0)