From 28c4001f5269eb170f14bd2829698ee402b2cfbf Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Mon, 13 May 2019 13:46:09 -0230 Subject: Update auto-logout to recognize idle time in background (#6593) * Fix wording of autoLogoutTimeLimitDescription * AppStateController and update auto-logout functionality --- ui/app/pages/routes/index.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'ui/app/pages/routes') diff --git a/ui/app/pages/routes/index.js b/ui/app/pages/routes/index.js index 9c30da086..9eeac2da2 100644 --- a/ui/app/pages/routes/index.js +++ b/ui/app/pages/routes/index.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Route, Switch, withRouter, matchPath } from 'react-router-dom' import { compose } from 'recompose' -import actions, {hideSidebar, hideWarning, lockMetamask} from '../../store/actions' +import actions from '../../store/actions' import log from 'loglevel' import IdleTimer from 'react-idle-timer' import {getMetaMaskAccounts, getNetworkIdentifier, preferencesSelector} from '../../selectors/selectors' @@ -99,7 +99,7 @@ class Routes extends Component { } renderRoutes () { - const { autoLogoutTimeLimit, lockMetamask } = this.props + const { autoLogoutTimeLimit, setLastActiveTime } = this.props const routes = ( @@ -122,10 +122,7 @@ class Routes extends Component { if (autoLogoutTimeLimit > 0) { return ( - + {routes} ) @@ -338,7 +335,7 @@ Routes.propTypes = { networkDropdownOpen: PropTypes.bool, showNetworkDropdown: PropTypes.func, hideNetworkDropdown: PropTypes.func, - lockMetamask: PropTypes.func, + setLastActiveTime: PropTypes.func, history: PropTypes.object, location: PropTypes.object, dispatch: PropTypes.func, @@ -447,11 +444,7 @@ function mapDispatchToProps (dispatch) { setCurrentCurrencyToUSD: () => dispatch(actions.setCurrentCurrency('usd')), toggleAccountMenu: () => dispatch(actions.toggleAccountMenu()), setMouseUserState: (isMouseUser) => dispatch(actions.setMouseUserState(isMouseUser)), - lockMetamask: () => { - dispatch(lockMetamask()) - dispatch(hideWarning()) - dispatch(hideSidebar()) - }, + setLastActiveTime: () => dispatch(actions.setLastActiveTime()), } } -- cgit