Skip to content

Commit

Permalink
fix: deposit popup not launching #84 (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk authored Apr 30, 2024
1 parent fa9b5f9 commit 054a0dc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 12 additions & 4 deletions src/components/popups/ProposalDeposit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,21 @@ const depositAmount = ref<number | null>(null);
const cliDepositInput = ref("");
const depositDenomDecimals = computed(() => {
return chainConfig.currencies.filter((x) => x.coinMinimalDenom == props.depositDenom)[0].coinDecimals ?? 0;
const currencies = chainConfig.currencies.filter((x) => x.coinMinimalDenom == props.depositDenom);
if (currencies.length <= 0) {
return 0;
}
return currencies[0].coinDecimals ?? 0;
});
const depositDenomDisplay = computed(() => {
return (
chainConfig.currencies.filter((x) => x.coinMinimalDenom == props.depositDenom)[0].coinDenom ?? props.depositDenom
);
const currencies = chainConfig.currencies.filter((x) => x.coinMinimalDenom == props.depositDenom);
if (!currencies) {
return props.depositDenom;
}
return currencies[0].coinDenom ?? props.depositDenom;
});
const resetDeposit = () => (depositAmount.value = null);
Expand Down
16 changes: 12 additions & 4 deletions src/components/proposals/ProposalWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,21 @@ const expectedResult = computed(() => {
});
const stakingDenomDisplay = computed(() => {
return (
chainConfig.currencies.filter((x) => x.coinMinimalDenom == depositDenom.value)[0]?.coinDenom ?? depositDenom.value
);
const currencies = chainConfig.currencies.filter((x) => x.coinMinimalDenom == depositDenom.value);
if (currencies.length <= 0) {
return depositDenom.value;
}
return currencies[0].coinDenom ?? depositDenom.value;
});
const stakingDenomDecimals = computed(() => {
return chainConfig.currencies.filter((x) => x.coinMinimalDenom == depositDenom.value)[0]?.coinDecimals ?? 0;
const currencies = chainConfig.currencies.filter((x) => x.coinMinimalDenom == depositDenom.value);
if (currencies.length <= 0) {
return 0;
}
return currencies[0].coinDecimals ?? 0;
});
function calculateWidthForTree(key: VoteTypes) {
Expand Down

0 comments on commit 054a0dc

Please sign in to comment.