This commit is contained in:
Georges KABBOUCHI 2021-08-29 01:28:58 +03:00
parent e562a91b2e
commit cc8faf253d
2 changed files with 16 additions and 4 deletions

View File

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

View File

@ -80,15 +80,27 @@ export const useWeb3 = () => {
}
const handleUpdate = async (update: ConnectorUpdate): Promise<void> => {
provider.value = update.provider
chainId.value =
if (update.provider) {
provider.value = update.provider
}
const cId =
update.chainId === undefined
? undefined
: normalizeChainId(update.chainId)
account.value =
if (cId) {
chainId.value = cId
}
const acc =
typeof update.account === 'string'
? normalizeAccount(update.account)
: update.account
if (acc) {
account.value = acc
}
}
const handleError = (e: Error): void => {