Skip to content

Commit 39ed7ed

Browse files
committed
fix free balance
1 parent 21129b8 commit 39ed7ed

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/components/Header.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default {
5353
title: "Basilisk",
5454
link: "https://app.basilisk.cloud/pools-and-farms",
5555
type: "external"
56-
},
56+
}
5757
]
5858
},
5959
@@ -76,7 +76,7 @@ export default {
7676
type: "external"
7777
}
7878
]
79-
},
79+
}
8080
],
8181
version: " "
8282
};
@@ -108,6 +108,16 @@ export default {
108108
},
109109
immediate: true
110110
},
111+
"RobonomicsProvider.isReady.value": {
112+
handler: function (newValue, oldValue) {
113+
if (newValue && !oldValue) {
114+
this.handlerAccount(
115+
this.$store.state.robonomicsUIvue.polkadot.address
116+
);
117+
}
118+
},
119+
immediate: true
120+
},
111121
$route: async function () {
112122
this.renderComponent = false;
113123
await this.$nextTick();
@@ -149,7 +159,7 @@ export default {
149159
this.unsubscribeBalance = await this.robonomics.account.getBalance(
150160
address,
151161
(r) => {
152-
const transferable = r.free.sub(r.feeFrozen);
162+
const transferable = r.free.sub(r.frozen);
153163
this.$store.commit(
154164
"polkadot/setBalanceXRT",
155165
round(

src/hooks/useBalance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const useBalance = (account) => {
1414
}
1515
const robonomics = getInstance();
1616
unsubscribe = await robonomics.account.getBalance(account.value, (r) => {
17-
balance.value = r.free.sub(r.feeFrozen).toNumber();
17+
balance.value = r.free.sub(r.frozen).toNumber();
1818
});
1919
});
2020
return { balance, unsubscribe };

0 commit comments

Comments
 (0)