Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 09d03e5

Browse files
committed
Show "loading" when payments balance is loading
Fix #3778 Fix #3785 or at least a gentle fallback Auditors: @diracdeltas @bbondy Test Plan: Offline case: 1. Disable internet 2. Re/open Brave 3. Open Preferences -> Payments 4. Observe that account balance is "loading..." and not 0 Online case: 1. Open Brave 2. Open Preferences -> Payments 3. Observe account balance is accurate
1 parent f63f2e4 commit 09d03e5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

app/extensions/brave/locales/en-US/preferences.properties

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ paymentsSidebarText2=All transaction IP addresses are anonymized with technology
2424
paymentsSidebarText3=Brave Bitcoin Wallets are provided through a partnership with:
2525
paymentsSidebarText4=Your contributions in the form of credit cards and bank cards are handled by:
2626
accountBalance=account balance
27+
accountBalanceLoading=loading...
2728
monthlyBudget=monthly budget
2829
status=status
2930
createWallet=create wallet

js/about/preferences.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,16 @@ class PaymentsTab extends ImmutableComponent {
709709
<tr>
710710
<td>
711711
<span id='fundsAmount'>
712-
{this.btcToCurrencyString(this.props.ledgerData.get('balance'))}
713-
<a href='https://brave.com/Payments_FAQ.html' target='_blank'>
714-
<span className='fa fa-question-circle fundsFAQ' />
715-
</a>
712+
{
713+
this.props.ledgerData.get('balance')
714+
? <span>
715+
{this.btcToCurrencyString(this.props.ledgerData.get('balance'))}
716+
<a href='https://brave.com/Payments_FAQ.html' target='_blank'>
717+
<span className='fa fa-question-circle fundsFAQ' />
718+
</a>
719+
</span>
720+
: <span data-l10n-id='accountBalanceLoading' />
721+
}
716722
</span>
717723
{this.walletButton}
718724
{this.paymentHistoryButton}

0 commit comments

Comments
 (0)