Skip to content

Commit 3f90e21

Browse files
author
cpl121
committed
fix: minor improvements
1 parent 8feb268 commit 3f90e21

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

packages/desktop/components/ManaBox.svelte

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
const extraMana: number = getExtraMana(NUMBER_OF_EXTRA_SLOTS_MANA)
2121
2222
let requiredTxManaCost: number = 0
23-
let secondsRemaining: number = 0
2423
let countdownInterval: NodeJS.Timeout
2524
let secondsToRefreshManaCost = NUMBER_OF_EXTRA_SLOTS_MANA * DEFAULT_SECONDS_PER_SLOT
2625
@@ -36,12 +35,8 @@
3635
transactionInfo.preparedTransactionError.message?.includes('slots remaining until enough mana')
3736
) {
3837
const splittedError = transactionInfo.preparedTransactionError.message?.split(' ')
39-
4038
const requiredManaForTransaction = splittedError[splittedError.indexOf('required') + 1]?.replace(',', '')
4139
requiredTxManaCost = Number(requiredManaForTransaction ?? 0)
42-
43-
const slotsRemaining = Number(splittedError.reverse()[0].replace('`', ''))
44-
secondsRemaining = slotsRemaining * DEFAULT_SECONDS_PER_SLOT
4540
} else if (transactionInfo?.preparedTransaction) {
4641
requiredTxManaCost =
4742
transactionInfo.preparedTransaction._preparedData?.transaction?.allotments?.reduce(
@@ -77,13 +72,11 @@
7772
<Text type={TextType.p} error classes="text-center">
7873
{localize('general.insufficientMana', {
7974
values: {
80-
availableMana,
81-
secondsRemaining,
75+
availableMana: formatTokenAmountBestMatch(availableMana, mana.metadata),
8276
},
8377
})}
8478
</Text>
85-
{/if}
86-
{#if showCountdown}
79+
{:else if showCountdown}
8780
<Text type={TextType.p} classes="text-center">
8881
{localize('general.secondsToRefreshManaCost', {
8982
values: {

packages/shared/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@
17191719
"verifyLedgerDepositAddress": "Please check the ledger device and verify that the deposit address matches the one displayed on the ledger device",
17201720
"manaCost": "Estimated Mana cost",
17211721
"availableMana": "Available mana",
1722-
"insufficientMana": "Insufficient mana {availableMana}, wait {secondsRemaining} seconds.",
1722+
"insufficientMana": "Insufficient {availableMana}.",
17231723
"secondsToRefreshManaCost": "{seconds} seconds to refresh the mana cost"
17241724
},
17251725
"filters":{

0 commit comments

Comments
 (0)