Merge branch 'new-CounterFire' of http://git.kingsome.cn/huangjinming/CounterFireGames into new-CounterFire
This commit is contained in:
commit
c33b30580c
@ -229,6 +229,7 @@ export class BlockChain {
|
|||||||
*/
|
*/
|
||||||
async checkAndChangeChain(targetChainId, provider) {
|
async checkAndChangeChain(targetChainId, provider) {
|
||||||
targetChainId = targetChainId || cfgChainId;
|
targetChainId = targetChainId || cfgChainId;
|
||||||
|
// passport只支持imtbl链, 不需要切换
|
||||||
if (!provider && this.store.walletType == 3) {
|
if (!provider && this.store.walletType == 3) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -238,6 +239,16 @@ export class BlockChain {
|
|||||||
console.log(`current chain: ${chainId}, want: ${targetChainId}`)
|
console.log(`current chain: ${chainId}, want: ${targetChainId}`)
|
||||||
chainId = await switchEthereumChain(provider.provider, 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() {
|
async checkPassportLogin() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user