Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuri committed May 9, 2022
1 parent b75188e commit 5334dd5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ class LedgerBridgeKeyring extends EventEmitter {
}

unlock (hdPath) {
if (this.isUnlocked() && !hdPath) {
return Promise.resolve('already unlocked')
}
const path = hdPath ? this._toLedgerPath(hdPath) : this.hdPath
return new Promise((resolve, reject) => {
this._sendMessage({
Expand All @@ -143,7 +146,7 @@ class LedgerBridgeKeyring extends EventEmitter {
addAccounts (n = 1) {

return new Promise((resolve, reject) => {
this.unlock()
this.unlock(this.hdPath)
.then(async (_) => {
const from = this.unlockedAccount
const to = from + n
Expand Down Expand Up @@ -511,7 +514,7 @@ class LedgerBridgeKeyring extends EventEmitter {
const from = (this.page - 1) * this.perPage
const to = from + this.perPage

await this.unlock()
await this.unlock(this.hdPath)
let accounts
if (this._isLedgerLiveHdPath()) {
accounts = await this._getAccountsBIP44(from, to)
Expand Down

0 comments on commit 5334dd5

Please sign in to comment.