From 3c6326e55f57d21ab76e44e70b2f916ef03f7622 Mon Sep 17 00:00:00 2001 From: Keno Dressel Date: Wed, 8 May 2024 16:47:32 +0200 Subject: [PATCH] fix: uses proper shallow ref for sdk --- src/store/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 63897063..0f5a7ea7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,4 +1,4 @@ -import { shallowReactive } from 'vue'; +import { shallowRef } from 'vue'; import { createStore } from 'vuex'; import { Node, @@ -121,7 +121,7 @@ export default createStore({ instance: new Node(network.url), })); - const instance = shallowReactive(new AeSdk({ nodes })); + const instance = shallowRef(new AeSdk({ nodes })); commit('setSdk', instance); await dispatch('selectNetwork', networkId); }, @@ -130,7 +130,7 @@ export default createStore({ name: network.networkName, instance: new Node(network.url), })); - const instance = shallowReactive( + const instance = shallowRef( new AeSdkAepp({ nodes, onNetworkChange: ({ networkId }) => { @@ -177,11 +177,8 @@ export default createStore({ const connectWallet = async (wallet) => { try { const { networkId } = await sdk.connectToWallet(wallet.getConnection()); - const ret = await sdk.subscribeAddress('subscribe', 'connected'); - const { - address: { current }, - } = ret; - const currentAccountAddress = Object.keys(current)[0]; + await sdk.subscribeAddress('subscribe', 'connected'); + const currentAccountAddress = sdk.addresses()[0]; if (!currentAccountAddress) return; stopScan?.(); commit('setAddress', currentAccountAddress);