diff --git a/src/ui/modal/modalRewardApprovalRequired/index.js b/src/ui/modal/modalRewardApprovalRequired/index.js index c3ab6bc9c..39e58b7fc 100644 --- a/src/ui/modal/modalRewardApprovalRequired/index.js +++ b/src/ui/modal/modalRewardApprovalRequired/index.js @@ -1,16 +1,24 @@ import { connect } from 'react-redux'; import { doHideModal } from 'redux/actions/app'; +import { withRouter } from 'react-router-dom'; import ModalRewardApprovalRequired from './view'; -const perform = dispatch => ({ +const perform = (dispatch, ownProps) => ({ doAuth: () => { + const { + location: { pathname }, + history, + } = ownProps; + const currentPath = pathname.split('/$/')[1]; dispatch(doHideModal()); - // dispatch(doAuthNavigate()); + history.push(`/$/auth?redirect=${currentPath}`); }, closeModal: () => dispatch(doHideModal()), }); -export default connect( - null, - perform -)(ModalRewardApprovalRequired); +export default withRouter( + connect( + null, + perform + )(ModalRewardApprovalRequired) +); diff --git a/src/ui/page/help/index.js b/src/ui/page/help/index.js index 5bf746fe0..ef28f2bc5 100644 --- a/src/ui/page/help/index.js +++ b/src/ui/page/help/index.js @@ -9,8 +9,8 @@ const select = state => ({ deamonSettings: selectDaemonSettings(state), }); -const perform = dispatch => ({ - // doAuth: () => dispatch(doAuthNavigate('/help')), +const perform = (dispatch, ownProps) => ({ + doAuth: () => ownProps.history.push('/$/auth?redirect=help'), fetchAccessToken: () => dispatch(doFetchAccessToken()), }); diff --git a/src/ui/redux/actions/app.js b/src/ui/redux/actions/app.js index 3db989eef..bb6be6580 100644 --- a/src/ui/redux/actions/app.js +++ b/src/ui/redux/actions/app.js @@ -23,6 +23,7 @@ import { } from 'redux/selectors/app'; import { doAuthenticate } from 'lbryinc'; import { lbrySettings as config, version as appVersion } from 'package.json'; +import { push } from 'connected-react-router'; // @if TARGET='app' const { autoUpdater } = remote.require('electron-updater'); @@ -388,7 +389,7 @@ export function doConditionalAuthNavigate(newSession) { const modal = selectModal(state); if (newSession || (modal && modal.id !== MODALS.EMAIL_COLLECTION)) { - // dispatch(doAuthNavigate()); + dispatch(push('/$/auth')); } }; }