Skip to content

Commit

Permalink
fix(packages/unlock-js): Fixed WalletSerive (#14023)
Browse files Browse the repository at this point in the history
* Update walletService.ts

* Update walletService.ts
  • Loading branch information
SVell authored Jun 10, 2024
1 parent 85dc815 commit 1b75c83
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/unlock-js/src/walletService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default class WalletService extends UnlockService {
if (signer) {
this.signer = signer
} else {
this.signer = this.provider.getSigner(0)
this.signer = await this.provider.getSigner()
}
const { chainId: networkId } = await this.provider.getNetwork()

Expand All @@ -117,14 +117,16 @@ export default class WalletService extends UnlockService {
* Function which yields the address of the account on the provider
*/
async getAccount() {
const account = await this.provider.getSigner()
const account = await this.provider.getSigner(0)

if (!account.length) {
const address = await account.getAddress()

if (!address) {
// We do not have an account, can't do anything until we have one.
return null
}

return account
return address
}

/**
Expand Down

0 comments on commit 1b75c83

Please sign in to comment.