aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-07-24 11:25:04 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-07-24 11:25:04 +0800
commit152246f3b0862c8c5a8b42872852d236400c0e9d (patch)
treeddcaf398ef77eb07d5de35cfa96ac8eaa559c3cd /ui/app/components
parent2359062b62cf65f38b36ccb6bb33fa7d15ada1ae (diff)
downloadtangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar.gz
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar.bz2
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar.lz
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar.xz
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.tar.zst
tangerine-wallet-browser-152246f3b0862c8c5a8b42872852d236400c0e9d.zip
Add close window support to signature requests. Move logic to actions
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js19
-rw-r--r--ui/app/components/pages/home.js12
2 files changed, 10 insertions, 21 deletions
diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
index 2811e6157..e1bf2210f 100644
--- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -8,9 +8,6 @@ import {
INSUFFICIENT_FUNDS_ERROR_KEY,
TRANSACTION_ERROR_KEY,
} from '../../../constants/error-keys'
-import {
- ENVIRONMENT_TYPE_NOTIFICATION,
-} from '../../../../../app/scripts/lib/enums'
export default class ConfirmTransactionBase extends Component {
static contextTypes = {
@@ -253,12 +250,8 @@ export default class ConfirmTransactionBase extends Component {
} else {
cancelTransaction(txData)
.then(() => {
- if (global.METAMASK_UI_TYPE === ENVIRONMENT_TYPE_NOTIFICATION) {
- return global.platform.closeCurrentWindow()
- } else {
- clearConfirmTransaction()
- history.push(DEFAULT_ROUTE)
- }
+ clearConfirmTransaction()
+ history.push(DEFAULT_ROUTE)
})
}
}
@@ -271,12 +264,8 @@ export default class ConfirmTransactionBase extends Component {
} else {
sendTransaction(txData)
.then(() => {
- if (global.METAMASK_UI_TYPE === ENVIRONMENT_TYPE_NOTIFICATION) {
- return global.platform.closeCurrentWindow()
- } else {
- clearConfirmTransaction()
- history.push(DEFAULT_ROUTE)
- }
+ clearConfirmTransaction()
+ history.push(DEFAULT_ROUTE)
})
}
}
diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js
index 38aa02dae..5e3fdc9af 100644
--- a/ui/app/components/pages/home.js
+++ b/ui/app/components/pages/home.js
@@ -27,19 +27,17 @@ const {
NOTICE_ROUTE,
} = require('../../routes')
+const { unconfirmedTransactionsCountSelector } = require('../../selectors/confirm-transaction')
+
class Home extends Component {
componentDidMount () {
const {
history,
- unapprovedTxs = {},
- unapprovedMsgCount = 0,
- unapprovedPersonalMsgCount = 0,
- unapprovedTypedMessagesCount = 0,
+ unconfirmedTransactionsCount = 0,
} = this.props
// unapprovedTxs and unapproved messages
- if (Object.keys(unapprovedTxs).length ||
- unapprovedTypedMessagesCount + unapprovedMsgCount + unapprovedPersonalMsgCount > 0) {
+ if (unconfirmedTransactionsCount > 0) {
history.push(CONFIRM_TRANSACTION_ROUTE)
}
}
@@ -167,6 +165,7 @@ Home.propTypes = {
isPopup: PropTypes.bool,
isMouseUser: PropTypes.bool,
t: PropTypes.func,
+ unconfirmedTransactionsCount: PropTypes.number,
}
function mapStateToProps (state) {
@@ -230,6 +229,7 @@ function mapStateToProps (state) {
// state needed to get account dropdown temporarily rendering from app bar
selected,
+ unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),
}
}