Skip to content

Commit

Permalink
fix: uses proper shallow ref for sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodressel committed May 8, 2024
1 parent e439792 commit 3c6326e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { shallowReactive } from 'vue';
import { shallowRef } from 'vue';
import { createStore } from 'vuex';
import {
Node,
Expand Down Expand Up @@ -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);
},
Expand All @@ -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 }) => {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3c6326e

Please sign in to comment.