diff options
Diffstat (limited to 'ui/app/components/pages')
-rw-r--r-- | ui/app/components/pages/home.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js index ffe35a2a8..177d9b4e7 100644 --- a/ui/app/components/pages/home.js +++ b/ui/app/components/pages/home.js @@ -27,21 +27,6 @@ const { } = require('../../routes') class Home extends Component { - componentDidMount () { - const { - unapprovedTxs = {}, - unapprovedMsgCount = 0, - unapprovedPersonalMsgCount = 0, - unapprovedTypedMessagesCount = 0, - } = this.props - - // unapprovedTxs and unapproved messages - if (Object.keys(unapprovedTxs).length || - unapprovedTypedMessagesCount + unapprovedMsgCount + unapprovedPersonalMsgCount > 0) { - this.props.history.push(CONFIRM_TRANSACTION_ROUTE) - } - } - render () { log.debug('rendering primary') const { @@ -51,6 +36,10 @@ class Home extends Component { currentView, activeAddress, seedWords, + unapprovedTxs = {}, + unapprovedMsgCount = 0, + unapprovedPersonalMsgCount = 0, + unapprovedTypedMessagesCount = 0, } = this.props // notices @@ -81,6 +70,16 @@ class Home extends Component { }) } + // unapprovedTxs and unapproved messages + if (Object.keys(unapprovedTxs).length || + unapprovedTypedMessagesCount + unapprovedMsgCount + unapprovedPersonalMsgCount > 0) { + return h(Redirect, { + to: { + pathname: CONFIRM_TRANSACTION_ROUTE, + }, + }) + } + // if (!props.noActiveNotices) { // log.debug('rendering notice screen for unread notices.') // return h(NoticeScreen, { |