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

Commit

Permalink
Initial check-in
Browse files Browse the repository at this point in the history
  • Loading branch information
mrose17 committed Jan 24, 2017
1 parent 8190b88 commit 84200ce
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
9 changes: 7 additions & 2 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ viewPaymentHistory=View Payment History…
paymentHistoryTitle=Your Payment History
paymentHistoryFooterText=Your next payment contribution is {{reconcileDate}}.
paymentHistoryOKText=OK
hideExcluded=Only show included sites
hideExcluded=Show only included sites
bravePayments=Brave Payments
beta=beta
contributionDate=Contribution Date
Expand Down Expand Up @@ -91,7 +91,7 @@ notifications=Show notifications
moneyAdd=Use your debit/credit card
moneyAddSubTitle=No Bitcoin needed!
outsideUSAPayment=Buy Bitcoin at our recommended source
coinbaseNotAvailable=Sorry! Adding funds with a credit/debit card is only available for contributions of $5/month at the moment.
coinbaseNotAvailable=Sorry! Adding funds with a credit/debit card is available only for contributions of $5/month at the moment.
add=Fund with debit/credit
transferTime=Transfer may take up to 40 minutes
addFundsTitle=Add funds…
Expand Down Expand Up @@ -159,6 +159,11 @@ advancedSettings=Advanced Settings...
advancedSettingsTitle=Advanced Settings for Brave Payments
ledgerRecoveryTitle=Recover your Brave wallet
ledgerRecoverySubtitle=Enter your recovery keys below
ledgerRecoverySucceeded=Success!
ledgerRecoveryFailedTitle=Recovery Failed
ledgerRecoveryFailedMessage=Please re-enter keys or try different keys.
ledgerRecoveryNetworkFailedTitle=Network Error
ledgerRecoveryNetworkFailedMessage=Please check your internet connection and try again.
ledgerRecoveryContent=The balance of the recovered wallet will be transferred to your new Brave wallet. The old wallet will still exist as an empty wallet.
ledgerBackupTitle=Backup your Brave wallet
ledgerBackupContent=Below, you will find the anonymized recovery keys that are required if you ever lose access to this computer.
Expand Down
27 changes: 21 additions & 6 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,22 +1148,37 @@ class PaymentsTab extends ImmutableComponent {
const l10nDataArgs = {
balance: (!balance ? '0.00' : balance)
}
const recoverySucceeded = this.props.ledgerData.get('recoverySucceeded')
const recoveryError = this.props.ledgerData.getIn(['error', 'error'])
const isNetworkError = typeof recoveryError === 'object'
console.log('recoverySucceeded=' + JSON.stringify(recoverySucceeded))
console.log('!!recoveryError=' + (!!recoveryError))
console.log('isNetworkError=' + isNetworkError)

return <div className='board'>
{
this.props.ledgerData.get('recoverySucceeded') === true
recoverySucceeded === true
? <div className='recoveryOverlay'>
<h1>Success!</h1>
<h1 data-l10n-id='ledgerRecoverySucceeded' />
<p className='spaceAround' data-l10n-id='balanceRecovered' data-l10n-args={JSON.stringify(l10nDataArgs)} />
<Button l10nId='ok' className='whiteButton inlineButton' onClick={this.clearRecoveryStatus.bind(this)} />
</div>
: null
}
{
this.props.ledgerData.get('recoverySucceeded') === false
(recoverySucceeded === false && recoveryError && isNetworkError)
? <div className='recoveryOverlay'>
<h1 className='recoveryError'>Recovery failed</h1>
<p className='spaceAround'>Please re-enter keys or try different keys.</p>
<h1 data-l10n-id='ledgerRecoveryNetworkFailedTitle' className='recoveryError' />
<p data-l10n-id='ledgerRecoveryNetworkFailedMessage' className='spaceAround' />
<Button l10nId='ok' className='whiteButton inlineButton' onClick={this.clearRecoveryStatus} />
</div>
: null
}
{
(recoverySucceeded === false && recoveryError && !isNetworkError)
? <div className='recoveryOverlay'>
<h1 data-l10n-id='ledgerRecoveryFailedTitle' />
<p data-l10n-id='ledgerRecoveryFailedMessage' className='spaceAround' />
<Button l10nId='ok' className='whiteButton inlineButton' onClick={this.clearRecoveryStatus} />
</div>
: null
Expand All @@ -1176,7 +1191,7 @@ class PaymentsTab extends ImmutableComponent {
<h3 data-l10n-id='firstRecoveryKey' />
<RecoveryKeyTextbox id='firstRecoveryKey' onChange={this.handleFirstRecoveryKeyChange} />
<h3 data-l10n-id='secondRecoveryKey' />
<RecoveryKeyTextbox id='secondRecoveryKey' onChange={this.handleFirstRecoveryKeyChange} />
<RecoveryKeyTextbox id='secondRecoveryKey' onChange={this.handleSecondRecoveryKeyChange} />
</SettingItem>
</SettingsList>
</div>
Expand Down

0 comments on commit 84200ce

Please sign in to comment.