Skip to content

Commit

Permalink
fix: ignore getAddress error
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Aug 17, 2022
1 parent 0b023ce commit df64eba
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/widget/src/providers/WalletProvider/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,16 @@ export const WalletProvider: FC<
);
};

export const extractAccountFromSigner = async (signer?: Signer) => ({
address: (await signer?.getAddress()) || undefined,
isActive: (signer && !!(await signer.getAddress()) === null) || !!signer,
signer,
chainId: (await signer?.getChainId()) || undefined,
});
export const extractAccountFromSigner = async (signer?: Signer) => {
try {
return {
address: (await signer?.getAddress()) || undefined,
isActive: (signer && !!(await signer.getAddress()) === null) || !!signer,
signer,
chainId: (await signer?.getChainId()) || undefined,
};
} catch (error) {
console.log(error);
return {};
}
};

0 comments on commit df64eba

Please sign in to comment.