aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-05-02 02:39:44 +0800
committerGitHub <noreply@github.com>2019-05-02 02:39:44 +0800
commit2ff522604b2a5f45697087613de5efb9bba58790 (patch)
treeb3036584a336da8fa4d4e1beced63c8b29a091e1
parentc7492f4f54acdab3b763b273481406c885199369 (diff)
parente6b9b5c5a9d25b70e9656a886b6d6053f160cd39 (diff)
downloadtangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar.gz
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar.bz2
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar.lz
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar.xz
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.tar.zst
tangerine-wallet-browser-2ff522604b2a5f45697087613de5efb9bba58790.zip
Merge pull request #6545 from whymarrh/tOrKey-ConfirmTransactionBase
Use tOrKey for actionKey in ConfirmTransactionBase
-rw-r--r--ui/app/helpers/higher-order-components/i18n-provider.js2
-rw-r--r--ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js4
2 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/helpers/higher-order-components/i18n-provider.js b/ui/app/helpers/higher-order-components/i18n-provider.js
index 0e34e17e0..298a12a28 100644
--- a/ui/app/helpers/higher-order-components/i18n-provider.js
+++ b/ui/app/helpers/higher-order-components/i18n-provider.js
@@ -19,7 +19,7 @@ class I18nProvider extends Component {
return t(current, key, ...args) || t(en, key, ...args) || `[${key}]`
},
tOrDefault: this.tOrDefault,
- tOrKey (key, ...args) {
+ tOrKey: (key, ...args) => {
return this.tOrDefault(key, key, ...args)
},
}
diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
index 678f64844..3c4e6dcac 100644
--- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -18,6 +18,7 @@ import AdvancedGasInputs from '../../components/app/gas-customization/advanced-g
export default class ConfirmTransactionBase extends Component {
static contextTypes = {
t: PropTypes.func,
+ tOrKey: PropTypes.func.isRequired,
metricsEvent: PropTypes.func,
}
@@ -546,7 +547,8 @@ export default class ConfirmTransactionBase extends Component {
toName={toName}
toAddress={toAddress}
showEdit={onEdit && !isTxReprice}
- action={this.context.t(actionKey) || getMethodName(name) || this.context.t('contractInteraction')}
+ // In the event that the key is falsy (and inherently invalid), use a fallback string
+ action={this.context.tOrKey(actionKey) || getMethodName(name) || this.context.t('contractInteraction')}
title={title}
titleComponent={this.renderTitleComponent()}
subtitle={subtitle}