Merge branch 'new-CounterFire' of http://git.kingsome.cn/huangjinming/CounterFireGames into new-CounterFire

This commit is contained in:
yuyongdong 2024-07-22 11:15:11 +08:00
commit c33b30580c

View File

@ -229,6 +229,7 @@ export class BlockChain {
*/
async checkAndChangeChain(targetChainId, provider) {
targetChainId = targetChainId || cfgChainId;
// passport只支持imtbl链, 不需要切换
if (!provider && this.store.walletType == 3) {
return
}
@ -238,6 +239,16 @@ export class BlockChain {
console.log(`current chain: ${chainId}, want: ${targetChainId}`)
chainId = await switchEthereumChain(provider.provider, targetChainId);
}
if (this.store.walletType == 3) {
const { provider, accounts } = await this.eoaWallet.web3Provider();
this.eoaProvider = provider;
} else {
const { provider, accounts } = await this.wallet.web3Provider();
this.web3Provider = provider;
this.eoaProvider = provider;
}
}
async checkPassportLogin() {