Skip to content

Commit

Permalink
GIX-1890: Fix after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
lmuntaner committed Sep 18, 2023
1 parent 598c5a1 commit b2c9a94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/lib/modals/neurons/DisburseMaturityModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
export let tokenSymbol: string;
// 99% of users will disburse more than the transaction fee.
// We don't want a possible error fetching the fee to disrupt the whole flow.
export let transactionFeeE8s = 0n;
export let minimumAmountE8s = 0n;
const steps: WizardSteps = [
{
Expand All @@ -41,15 +41,15 @@
(availableMaturityE8s * BigInt(percentageToDisburse)) / 100n;
let disableDisburse = false;
$: disableDisburse = selectedMaturityE8s < transactionFeeE8s;
$: disableDisburse = selectedMaturityE8s < minimumAmountE8s;
// Show the text only if the selected percentage is greater than 0.
let disabledText: string | undefined = undefined;
$: disabledText =
disableDisburse && percentageToDisburse > 0
? replacePlaceholders(
$i18n.neuron_detail.disburse_maturity_modal_disabled_tooltip,
{ $amount: formatToken({ value: transactionFeeE8s }) }
{ $amount: formatToken({ value: minimumAmountE8s }) }
)
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import { snsProjectMainAccountStore } from "$lib/derived/sns/sns-project-accounts.derived";
import { shortenWithMiddleEllipsis } from "$lib/utils/format.utils";
import { tokensStore } from "$lib/stores/tokens.store";
import { selectedUniverseIdStore } from "$lib/derived/selected-universe.derived";
import type { IcrcTokenMetadata } from "$lib/types/icrc";
export let neuron: SnsNeuron;
Expand All @@ -27,7 +26,7 @@
);
let token: IcrcTokenMetadata | undefined;
$: token = $tokensStore[$selectedUniverseIdStore.toText()]?.token;
$: token = $tokensStore[rootCanisterId.toText()]?.token;
const dispatcher = createEventDispatcher();
const close = () => dispatcher("nnsClose");
Expand Down Expand Up @@ -58,7 +57,7 @@

<DisburseMaturityModal
availableMaturityE8s={neuron.maturity_e8s_equivalent}
transactionFeeE8s={token?.fee}
minimumAmountE8s={token?.fee}
tokenSymbol={token?.symbol ?? ""}
on:nnsDisburseMaturity={disburseMaturity}
on:nnsClose
Expand Down

0 comments on commit b2c9a94

Please sign in to comment.