diff options
Diffstat (limited to 'ui/app/selectors.js')
-rw-r--r-- | ui/app/selectors.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/ui/app/selectors.js b/ui/app/selectors.js index a29294b86..d86462275 100644 --- a/ui/app/selectors.js +++ b/ui/app/selectors.js @@ -16,8 +16,7 @@ const selectors = { transactionsSelector, accountsWithSendEtherInfoSelector, getCurrentAccountWithSendEtherInfo, - getGasPrice, - getGasLimit, + getGasIsLoading, getForceGasMin, getAddressBook, getSendFrom, @@ -28,6 +27,7 @@ const selectors = { autoAddToBetaUI, getSendMaxModeState, getCurrentViewContext, + getTotalUnapprovedCount, } module.exports = selectors @@ -117,12 +117,8 @@ function transactionsSelector (state) { .sort((a, b) => b.time - a.time) } -function getGasPrice (state) { - return state.metamask.send.gasPrice -} - -function getGasLimit (state) { - return state.metamask.send.gasLimit +function getGasIsLoading (state) { + return state.appState.gasIsLoading } function getForceGasMin (state) { @@ -186,3 +182,15 @@ function getCurrentViewContext (state) { const { currentView = {} } = state.appState return currentView.context } + +function getTotalUnapprovedCount ({ metamask }) { + const { + unapprovedTxs = {}, + unapprovedMsgCount, + unapprovedPersonalMsgCount, + unapprovedTypedMessagesCount, + } = metamask + + return Object.keys(unapprovedTxs).length + unapprovedMsgCount + unapprovedPersonalMsgCount + + unapprovedTypedMessagesCount +} |