diff --git a/app/browser/api/ledger.js b/app/browser/api/ledger.js index 018adf3df8c..167361a9d07 100644 --- a/app/browser/api/ledger.js +++ b/app/browser/api/ledger.js @@ -155,7 +155,7 @@ const notifications = { }, onLaunch: (state) => { if (!getSetting(settings.PAYMENTS_ENABLED)) { - return + return state } // One time conversion of wallet @@ -163,12 +163,14 @@ const notifications = { const hasUpgradedWallet = state.getIn(['migrations', 'batMercuryTimestamp']) !== state.getIn(['migrations', 'btc2BatTimestamp']) if (!isNewInstall && !hasUpgradedWallet) { module.exports.transitionWalletToBat(state) + } else { + state = state.setIn(['migrations', 'btc2BatTransitionDone'], true) } if (hasFunds(state)) { // Don't bother processing the rest, which are only notifications. if (!getSetting(settings.PAYMENTS_NOTIFICATIONS)) { - return + return state } // Show one-time BAT conversion message: @@ -183,6 +185,8 @@ const notifications = { notifications.showBraveWalletUpdated() } } + + return state }, onInterval: (state) => { if (getSetting(settings.PAYMENTS_ENABLED)) { @@ -2002,7 +2006,7 @@ const onInitRead = (state, parsedData) => { getBalance(state) // Show relevant browser notifications on launch - notifications.onLaunch(state) + state = notifications.onLaunch(state) return state } @@ -2270,6 +2274,7 @@ const transitionWalletToBat = (state) => { newClient = true appActions.onLedgerCallback(result, random.randomInt({ min: miliseconds.minute, max: 10 * miliseconds.minute })) appActions.onBitcoinToBatTransitioned() + notifications.showBraveWalletUpdated() } }) } catch (ex) { diff --git a/app/browser/reducers/ledgerReducer.js b/app/browser/reducers/ledgerReducer.js index 6c3afe3bf6f..5238e7b4e82 100644 --- a/app/browser/reducers/ledgerReducer.js +++ b/app/browser/reducers/ledgerReducer.js @@ -320,6 +320,7 @@ const ledgerReducer = (state, action, immutableAction) => { case appConstants.APP_ON_BTC_TO_BAT_TRANSITIONED: { state = state.setIn(['migrations', 'btc2BatTimestamp'], new Date().getTime()) + state = state.setIn(['migrations', 'btc2BatTransitionDone'], true) break } case appConstants.APP_ON_LEDGER_QR_GENERATED: diff --git a/app/browser/tabs.js b/app/browser/tabs.js index 2ffd180b6a7..3600f830d82 100644 --- a/app/browser/tabs.js +++ b/app/browser/tabs.js @@ -158,6 +158,7 @@ const updateAboutDetails = (tab, tabValue) => { const ledgerInfo = ledgerState.getInfoProps(appState) const synopsis = ledgerState.getAboutData(appState) const wizardData = ledgerState.geWizardData(appState) + const migration = appState.get('migrations') const preferencesData = appState.getIn(['about', 'preferences']) const appSettings = appState.get('settings') let allSiteSettings = appState.get('siteSettings') @@ -198,6 +199,7 @@ const updateAboutDetails = (tab, tabValue) => { .merge(synopsis) .merge(preferencesData) .set('wizardData', wizardData) + .set('migration', migration) tab.send(messages.LEDGER_UPDATED, ledgerData.toJS()) tab.send(messages.SETTINGS_UPDATED, appSettings.toJS()) tab.send(messages.SITE_SETTINGS_UPDATED, allSiteSettings.toJS()) diff --git a/app/extensions/brave/locales/en-US/preferences.properties b/app/extensions/brave/locales/en-US/preferences.properties index e5b17befb87..e7e7f6c7a84 100644 --- a/app/extensions/brave/locales/en-US/preferences.properties +++ b/app/extensions/brave/locales/en-US/preferences.properties @@ -166,6 +166,8 @@ lastContribution=Last contribution: lastPass=LastPass® ledgerBackupContent=Below, you will find the anonymized recovery key that is required if you ever lose access to this computer.
Make sure you keep this key private, or else your wallet will be compromised. ledgerBackupTitle=Backup your Brave wallet +leaderLoaderText1=We are now converting your Brave Wallet from Bitcoin to BAT (Basic Attention Token). +leaderLoaderText2=This can take a few minutes ledgerPaymentsShown=Brave Payments ledgerRecoveryContent=Your previous wallet will now be used. Your new wallet will be discarded. ledgerRecoveryFailedMessage=Please re-enter keys or try different keys. diff --git a/app/renderer/components/preferences/payment/enabledContent.js b/app/renderer/components/preferences/payment/enabledContent.js index 59d5238efe4..468e7e08583 100644 --- a/app/renderer/components/preferences/payment/enabledContent.js +++ b/app/renderer/components/preferences/payment/enabledContent.js @@ -10,6 +10,8 @@ const moment = require('moment') const {batToCurrencyString, formatCurrentBalance, formattedDateFromTimestamp, walletStatus} = require('../../../../common/lib/ledgerUtil') const {l10nErrorText} = require('../../../../common/lib/httpUtil') const {changeSetting} = require('../../../lib/settingsUtil') +const getSetting = require('../../../../../js/settings').getSetting +const settings = require('../../../../../js/constants/settings') // components const ImmutableComponent = require('../../immutableComponent') @@ -21,15 +23,12 @@ const LedgerTable = require('./ledgerTable') // style const globalStyles = require('../../styles/global') const {paymentStylesVariables} = require('../../styles/payment') +const {loaderAnimation} = require('../../styles/animations') const cx = require('../../../../../js/lib/classSet') // Actions const appActions = require('../../../../../js/actions/appActions') -// other -const getSetting = require('../../../../../js/settings').getSetting -const settings = require('../../../../../js/constants/settings') - // TODO: report when funds are too low // TODO: support non-USD currency class EnabledContent extends ImmutableComponent { @@ -171,11 +170,25 @@ class EnabledContent extends ImmutableComponent { render () { const ledgerData = this.props.ledgerData const walletStatusText = walletStatus(ledgerData) - - return
-
-
-
+ const inTranstion = !(ledgerData.getIn(['migration', 'btc2BatTransitionDone'])) + + return
+
+

+

+

+

+
+
+
+
+
+
+
+
+
+
+
{this.walletButton()}
-
+
{this.lastReconcileMessage()}
-
+
{ ledgerData.get('error') && ledgerData.get('error').get('caller') === 'getWalletProperties' ?
:
{this.nextReconcileMessage()}
}
-
{}} + onClick={enableSettings ? this.props.showOverlay.bind(this, 'advancedSettings') : () => {}} />
diff --git a/app/renderer/components/styles/animations.js b/app/renderer/components/styles/animations.js index 54c421d03aa..b46c06aa250 100644 --- a/app/renderer/components/styles/animations.js +++ b/app/renderer/components/styles/animations.js @@ -31,8 +31,21 @@ const widthIncreaseKeyframes = (start, end) => ({ } }) +const loaderAnimation = { + '0': { + transform: 'translate(0,0)' + }, + '50%': { + transform: 'translate(0,15px)' + }, + '100%': { + transform: 'translate(0,0)' + } +} + module.exports = { spinKeyframes, opacityIncreaseKeyframes, - widthIncreaseKeyframes + widthIncreaseKeyframes, + loaderAnimation }