diff --git a/app/components/Web3Provider.vue b/app/components/Web3Provider.vue index 07d63f6..18ebdea 100644 --- a/app/components/Web3Provider.vue +++ b/app/components/Web3Provider.vue @@ -11,7 +11,8 @@ import '@vue-dapp/vd-board/dist/style.css' const dappStore = useDappStore() const { isConnected, user } = storeToRefs(dappStore) -const { onActivated, onChanged, onDeactivated, setDumb } = useWalletStore() +const pinia = usePinia() +const { onActivated, onChanged, onDeactivated, setDumb } = useWalletStore(pinia) setDumb(false) onActivated(async ({ address, provider, chainId }) => { diff --git a/app/components/wallet/UserStatus.vue b/app/components/wallet/UserStatus.vue index 89e5c3c..14e6681 100644 --- a/app/components/wallet/UserStatus.vue +++ b/app/components/wallet/UserStatus.vue @@ -7,8 +7,9 @@ import { useBoardStore } from '@vue-dapp/vd-board' const { open } = useBoardStore() -const { disconnect } = useWalletStore() -const { connector, status, address, isConnected, dumb } = storeToRefs(useWalletStore()) +const pinia = usePinia() +const { disconnect } = useWalletStore(pinia) +const { connector, status, address, isConnected } = storeToRefs(useWalletStore(pinia)) const dappStore = useDappStore() const { isNetworkUnmatched } = storeToRefs(dappStore) @@ -16,7 +17,7 @@ const { isNetworkUnmatched } = storeToRefs(dappStore) async function onSwitchChain() { try { if (connector.value) { - await connector.value.switchChain?.(dappStore.chainId) + await connector.value.switchChain(dappStore.chainId) } } catch (err: any) { console.error(err) diff --git a/packages/core/package.json b/packages/core/package.json index 415acd3..0d6f9da 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -10,7 +10,11 @@ "module": "./dist/core.js", "types": "./dist/index.d.ts", "exports": { - ".": { + "development": { + "import": "./src/index.ts", + "require": "./src/index.ts" + }, + "default": { "import": "./dist/core.js", "require": "./dist/core.umd.cjs" } diff --git a/packages/vd-board/package.json b/packages/vd-board/package.json index 6236627..caf3740 100644 --- a/packages/vd-board/package.json +++ b/packages/vd-board/package.json @@ -10,8 +10,14 @@ "types": "./dist/index.d.ts", "exports": { ".": { - "import": "./dist/vd-board.js", - "require": "./dist/vd-board.umd.cjs" + "development": { + "import": "./src/index.ts", + "require": "./src/index.ts" + }, + "default": { + "import": "./dist/vd-board.js", + "require": "./dist/vd-board.umd.cjs" + } }, "./dist/style.css": "./dist/style.css" }, diff --git a/packages/walletconnect/package.json b/packages/walletconnect/package.json index afe57b8..fdc3482 100644 --- a/packages/walletconnect/package.json +++ b/packages/walletconnect/package.json @@ -10,7 +10,11 @@ "module": "./dist/walletconnect.js", "types": "./dist/index.d.ts", "exports": { - ".": { + "development": { + "import": "./src/index.ts", + "require": "./src/index.ts" + }, + "default": { "import": "./dist/walletconnect.js", "require": "./dist/walletconnect.umd.cjs" }