Skip to content

Commit

Permalink
fix negative shielding allowance
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Oct 23, 2024
1 parent 358d898 commit f73d15f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1482,12 +1482,15 @@ const createTestingAccount = () => {
};

const computedShieldingMax = computed(() => {
return Math.min(
shieldingLimit.value -
accountStore.getDecimalBalanceFree(incogniteeSidechain.value),
accountStore.getDecimalBalanceTransferable(shieldingTarget.value) -
accountStore.getDecimalExistentialDeposit(shieldingTarget.value) -
0.1,
return Math.max(
0,
Math.min(
shieldingLimit.value -
accountStore.getDecimalBalanceFree(incogniteeSidechain.value),
accountStore.getDecimalBalanceTransferable(shieldingTarget.value) -
accountStore.getDecimalExistentialDeposit(shieldingTarget.value) -
0.1,
),
);
});

Expand Down

0 comments on commit f73d15f

Please sign in to comment.