This commit is contained in:
Georges KABBOUCHI 2021-08-29 02:44:41 +03:00
parent 4df5a4f942
commit 1f689f6f19
2 changed files with 18 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@kabbouchi/vue-web3",
"version": "0.2.12",
"version": "0.2.13",
"description": "Vue web3 composition api",
"license": "MIT",
"main": "dist/cjs/index.js",

View File

@ -85,19 +85,32 @@ export const useWeb3 = () => {
return
}
if (update.provider) {
provider.value = update.provider
}
const cId =
update.chainId === undefined
? undefined
: normalizeChainId(update.chainId)
if (
cId !== undefined &&
!!connector.value.supportedChainIds &&
!connector.value.supportedChainIds.includes(cId)
) {
const e = new UnsupportedChainIdError(
cId,
connector.value.supportedChainIds,
)
onErrorCb.value ? onErrorCb.value(e) : handleError(e)
return
}
if (cId) {
chainId.value = cId
}
if (update.provider) {
provider.value = update.provider
}
const acc =
typeof update.account === 'string'
? normalizeAccount(update.account)