mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +01:00
624139a00f
* Remove unused sendWarnings The send warnings state and associated component is no longer used anywhere. * Remove unused subtitleParams The `subtitleParams` SendHeader prop was being ignored. It has been removed, along with associated selectors and tests.
29 lines
503 B
JavaScript
29 lines
503 B
JavaScript
const {
|
|
getSelectedToken,
|
|
getSendEditingTransactionId,
|
|
getSendTo,
|
|
} = require('../send.selectors.js')
|
|
|
|
const selectors = {
|
|
getTitleKey,
|
|
}
|
|
|
|
module.exports = selectors
|
|
|
|
function getTitleKey (state) {
|
|
const isEditing = Boolean(getSendEditingTransactionId(state))
|
|
const isToken = Boolean(getSelectedToken(state))
|
|
|
|
if (!getSendTo(state)) {
|
|
return 'addRecipient'
|
|
}
|
|
|
|
if (isEditing) {
|
|
return 'edit'
|
|
} else if (isToken) {
|
|
return 'sendTokens'
|
|
} else {
|
|
return 'sendETH'
|
|
}
|
|
}
|