Skip to content

Commit 8c6f083

Browse files
committed
Merge branch 'develop' into release/1.33.0
2 parents 3168611 + 2fdf90e commit 8c6f083

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.prettierrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ module.exports = {
55
printWidth: 80,
66
tabWidth: 2,
77
arrowParens: 'avoid',
8-
svelteSortOrder: 'options-scripts-styles-markup',
9-
plugins: ['prettier-plugin-svelte']
8+
svelteSortOrder: 'options-scripts-styles-markup'
109
}

src/modules/select/wallets/ledger.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ async function ledgerProvider(options: LedgerProviderOptions) {
8989
const { Transaction } = await import('@ethereumjs/tx')
9090
const { default: Common } = await import('@ethereumjs/common')
9191
const ethUtil = await import('ethereumjs-util')
92-
const buffer = await import('buffer')
9392
const { TypedDataUtils } = await import('eth-sig-util')
9493

9594
const domainHash = (message: any) => {
@@ -232,17 +231,19 @@ async function ledgerProvider(options: LedgerProviderOptions) {
232231
}
233232

234233
// Get the Transport class
235-
const Transport =
236-
LedgerTransport || (await supportsWebUSB())
234+
let Transport = LedgerTransport
235+
if (!Transport) {
236+
Transport = (await supportsWebUSB())
237237
? (await import('@ledgerhq/hw-transport-webusb')).default
238238
: (await import('@ledgerhq/hw-transport-u2f')).default
239-
239+
}
240240
transport = await Transport.create()
241241

242242
eth = new Eth(transport)
243243

244244
Transport.listen(observer)
245245
} catch (error) {
246+
console.error(error)
246247
throw new Error('Error connecting to Ledger wallet')
247248
}
248249
}
@@ -300,6 +301,7 @@ async function ledgerProvider(options: LedgerProviderOptions) {
300301

301302
return account
302303
} catch (error) {
304+
console.error({ error })
303305
throw new Error('There was a problem accessing your Ledger accounts.')
304306
}
305307
}

0 commit comments

Comments
 (0)