diff options
Diffstat (limited to 'ui/app/components/pages/home.js')
-rw-r--r-- | ui/app/components/pages/home.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/ui/app/components/pages/home.js b/ui/app/components/pages/home.js index 177d9b4e7..7857a2a99 100644 --- a/ui/app/components/pages/home.js +++ b/ui/app/components/pages/home.js @@ -27,6 +27,22 @@ const { } = require('../../routes') class Home extends Component { + componentDidMount () { + const { + history, + unapprovedTxs = {}, + unapprovedMsgCount = 0, + unapprovedPersonalMsgCount = 0, + unapprovedTypedMessagesCount = 0, + } = this.props + + // unapprovedTxs and unapproved messages + if (Object.keys(unapprovedTxs).length || + unapprovedTypedMessagesCount + unapprovedMsgCount + unapprovedPersonalMsgCount > 0) { + history.push(CONFIRM_TRANSACTION_ROUTE) + } + } + render () { log.debug('rendering primary') const { @@ -36,10 +52,6 @@ class Home extends Component { currentView, activeAddress, seedWords, - unapprovedTxs = {}, - unapprovedMsgCount = 0, - unapprovedPersonalMsgCount = 0, - unapprovedTypedMessagesCount = 0, } = this.props // notices @@ -70,16 +82,6 @@ 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, { |