Skip to content

Commit

Permalink
fix: Fix Wallet Main Currency Name - MEED-2307 - Meeds-io/meeds#1010 (#…
Browse files Browse the repository at this point in the history
…392)

Prior to this change, the display of Matic amounts was made in ehter
instead of Matic. This change will fix it by introducing two labels, one
for name and another for symbol.
  • Loading branch information
boubaker authored Jul 21, 2023
1 parent 36a2d56 commit f2ef7b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,6 @@ exoplatform.wallet.label.metamask.buttonTitle=Connect with metamask Wallet
exoplatform.wallet.metamask.error.transactionFailed=Transaction failed
exoplatform.wallet.metamask.message.transactionSent=Transaction sent
exoplatform.wallet.message.followTransaction={0} link to follow your transaction

wallet.mainCurrency=Matic
wallet.mainCurrencySymbol=Matic
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ export default {
},
etherAccountDetails() {
return {
title: 'ether',
title: this.$t('wallet.mainCurrency'),
icon: 'ether',
symbol: 'ether',
symbol: this.$t('wallet.mainCurrencySymbol'),
isContract: false,
balance: 10, // Fake balance to not display unsufficient funds
address: this.walletAddress,
Expand Down Expand Up @@ -532,9 +532,9 @@ export default {
this.selectedWalletAddress = wallet.address;
this.selectedWallet = wallet;
this.selectedWalletDetails = {
title: 'ether',
title: this.$t('wallet.mainCurrency'),
icon: 'fab fa-ethereum',
symbol: 'ether',
symbol: this.$t('wallet.mainCurrencySymbol'),
address: this.selectedWalletAddress,
balance: wallet.etherBalance,
balanceFiat: wallet.fiatBalance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
}
this.wallet = wallet;
this.etherAmount = etherAmount;
this.transactionLabel = `Send ether for wallet of ${this.wallet.type} ${this.wallet.name}`;
this.transactionLabel = `Send ${this.$t('wallet.mainCurrency')} for wallet of ${this.wallet.type} ${this.wallet.name}`;
this.transactionMessage = initialFundsMessage;
this.error = null;
Expand All @@ -156,7 +156,7 @@ export default {
if (resp && resp.ok) {
return resp.text();
} else {
throw new Error(`Error sending ether to wallet ${this.wallet.address}`);
throw new Error(`Error sending ${this.$t('wallet.mainCurrency')} to wallet ${this.wallet.address}`);
}
}).then((hash) => {
this.$emit('sent', hash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<v-list-item-content v-if="item.type === 'ether' && item.value && Number(item.value)" class="transactionDetailActions">
<v-list-item-title :class="item.adminIcon ? '' : (item.pending || item.succeeded) ? 'primary--text' : 'red--text'">
<span>
{{ toFixed(item.value) }} ether
{{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }}
</span>
</v-list-item-title>
<v-list-item-subtitle v-if="item.amountFiat">
Expand All @@ -269,7 +269,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
v-else-if="item.value && Number(item.value)"
:class="(item.pending || item.succeeded) ? 'primary--text' : 'red--text'">
<span>
{{ toFixed(item.value) }} ether
{{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }}
</span>
</v-list-item-title>
<v-list-item-subtitle
Expand Down Expand Up @@ -393,7 +393,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
</v-list-item-content>
<v-list-item-content class="align-end text-end">
<div class="no-wrap">
{{ toFixed(item.value) }} ether
{{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }}
</div>
</v-list-item-content>
</v-list-item>
Expand Down Expand Up @@ -469,8 +469,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
{{ toFixed(item.feeFiat) }} {{ fiatSymbol }}
<v-icon
v-if="item.noContractFunds"
color="orange"
title="You financed transaction fee with ether instead of Token.">
color="orange">
warning
</v-icon>
</div>
Expand Down

0 comments on commit f2ef7b0

Please sign in to comment.