File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
launcher/src/components/UI/staking-page
management/components/val-rewards Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -562,6 +562,11 @@ const withdrawModalHandler = () => {
562
562
const withdrawValidatorKey = async () => {
563
563
stakingStore .withdrawAndExitResponse = null ;
564
564
const key = stakingStore .selectedSingleKeyToWithdraw ;
565
+ if (! stakingStore .selectedServiceToFilter ) {
566
+ stakingStore .selectedServiceToFilter = serviceStore .installedServices .find (
567
+ (service ) => service? .config ? .serviceID === key? .validatorID
568
+ );
569
+ }
565
570
566
571
try {
567
572
let res;
Original file line number Diff line number Diff line change @@ -36,18 +36,21 @@ const ttlBal = t("displayValidator.ttlBal");
36
36
37
37
const stakingStore = useStakingStore ();
38
38
39
- // Computed property to get the total number of keys based on validatorID
40
39
const totalKeys = computed (() => {
41
- return stakingStore .keyNumbers ;
40
+ return stakingStore .keys ? . filter (( key ) => key . key && key . key . trim () !== " " ). length || 0 ;
42
41
});
43
42
44
- // Computed property to calculate the total balance for the validator service
45
43
const totalBalance = computed (() => {
46
44
const validatorID = stakingStore .selectedServiceToFilter ? .config ? .serviceID ;
47
- if (! validatorID) return 0 ;
48
- const keysForValidator = stakingStore .keys .filter ((key ) => key .validatorID === validatorID);
49
- return keysForValidator .reduce ((sum , key ) => {
50
- return ! isNaN (key .balance ) ? (sum += key .balance ) : (sum += 0 );
45
+
46
+ if (validatorID) {
47
+ const keysForValidator = stakingStore .keys .filter ((key ) => key .validatorID === validatorID);
48
+ return keysForValidator .reduce ((sum , key ) => {
49
+ return ! isNaN (key .balance ) ? (sum += key .balance ) : sum;
50
+ }, 0 );
51
+ }
52
+ return stakingStore .keys .reduce ((sum , key ) => {
53
+ return ! isNaN (key .balance ) ? (sum += key? .balance ) : sum;
51
54
}, 0 );
52
55
});
53
56
< / script>
Original file line number Diff line number Diff line change 77
77
</template >
78
78
79
79
<script setup>
80
- import { useStakingStore } from " @/store/theStaking" ;
81
80
import { useDeepClone , useTruncate } from " @/composables/utils" ;
81
+ import { useStakingStore } from " @/store/theStaking" ;
82
82
import { computed , ref , watch } from " vue" ;
83
83
84
84
const emit = defineEmits ([" confirmWithdraw" , " exportMessage" ]);
You can’t perform that action at this time.
0 commit comments