Skip to content

Commit

Permalink
fixing the case when the injected provider does not have an account
Browse files Browse the repository at this point in the history
  • Loading branch information
Viterbo committed Nov 28, 2023
1 parent 3751139 commit 63f4239
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/antelope/chains/EVMChainSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export default abstract class EVMChainSettings implements ChainSettings {
// we fix the supportedInterfaces property if it is undefined in the response but present in the request
Object.values(response.contracts).forEach((contract) => {
contract.supportedInterfaces = contract.supportedInterfaces ||
params.type ? [params.type?.toLocaleLowerCase() as string] : undefined;
params.type ? [params.type?.toLowerCase() as string] : undefined;
});

this.processNftContractsCalldata(response.contracts);
Expand Down
6 changes: 4 additions & 2 deletions src/antelope/wallets/authenticators/WalletConnectAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ export class WalletConnectAuth extends EVMAuthenticator {
if (typeof provider === 'undefined') {
this.usingQR = true;
} else {
const providerAddress = (provider._state?.accounts) ? provider._state?.accounts[0] : '';
const providerAddress = (provider._state?.accounts) ? provider._state?.accounts[0]??'' : '';
console.log('provider', provider); // FIXME:
this.trace('walletConnectLogin', 'providerAddress:', providerAddress, 'address:', address);
const sameAddress = providerAddress.toLocaleLowerCase() === address.toLocaleLowerCase();
this.usingQR = !sameAddress;
this.trace('walletConnectLogin', 'providerAddress:', providerAddress, 'address:', address, 'sameAddress:', sameAddress);
this.trace('walletConnectLogin', 'sameAddress:', sameAddress);
}
this.trace('walletConnectLogin', 'using QR:', this.usingQR);

Expand Down

0 comments on commit 63f4239

Please sign in to comment.