1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Merge pull request #6545 from whymarrh/tOrKey-ConfirmTransactionBase

Use tOrKey for actionKey in ConfirmTransactionBase
This commit is contained in:
Thomas Huang 2019-05-01 11:39:44 -07:00 committed by GitHub
commit 2ff522604b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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)
},
}

View File

@ -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}