Skip to content

Commit

Permalink
fix: unknown account #0 (LF-3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Jul 3, 2023
1 parent 44879c6 commit 6f67d4f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class InjectedConnector extends events.EventEmitter implements Wallet {
await this.calcAccountData();
}
} catch (e) {
//
throw e;
}
}

Expand Down Expand Up @@ -173,7 +173,14 @@ export class InjectedConnector extends events.EventEmitter implements Wallet {
this.windowProvider,
'any',
);
const accounts = await provider.listAccounts();

if (!accounts.length) {
return;
}

const signer = provider.getSigner();

this.account = {
chainId: await signer.getChainId(),
address: await signer.getAddress(),
Expand Down

0 comments on commit 6f67d4f

Please sign in to comment.