Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed Apr 6, 2022
1 parent eac3474 commit 720d402
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/components/theme/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import jwtDecode from 'jwt-decode';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { asyncConnect, Helmet } from '@plone/volto/helpers';
import { asyncConnect, Helmet, withRouter } from '@plone/volto/helpers';

Check warning on line 11 in src/components/theme/App/App.jsx

View workflow job for this annotation

GitHub Actions / build (16.x, 3.7)

'asyncConnect' is defined but never used
import { Segment } from 'semantic-ui-react';
import { Outlet } from 'react-router-dom';
import { Slide, ToastContainer, toast } from 'react-toastify';
Expand Down Expand Up @@ -273,9 +273,10 @@ export default compose(
// },
// ]),
injectIntl,
withRouter,
connect(
(state, props) => ({
pathname: state.router.location.pathname,
pathname: props.location.pathname,
token: state.userSession.token,
userId: state.userSession.token
? jwtDecode(state.userSession.token).sub
Expand Down
4 changes: 2 additions & 2 deletions src/components/theme/Login/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ export default compose(
loading: state.userSession.login.loading,
token: state.userSession.token,
returnUrl:
qs.parse(state.router.location.search).return_url ||
state.router.location.pathname
qs.parse(props.location.search).return_url ||
props.location.pathname
.replace(/\/login$/, '')
.replace(/\/logout$/, '') ||
'/',
Expand Down
2 changes: 1 addition & 1 deletion src/components/theme/Logout/Logout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Logout extends Component {

export default connect(
(state, props) => ({
query: qs.parse(state.router.location.search),
query: qs.parse(props.location.search),
}),
{ logout, purgeMessages },
)(Logout);
9 changes: 4 additions & 5 deletions src/components/theme/View/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class View extends Component {
}

export default compose(
withRouter,
injectIntl,
withRouter,
connect(
(state, props) => ({
actions: state.actions.actions,
Expand All @@ -277,11 +277,10 @@ export default compose(
error: state.content.get.error,
apiError: state.apierror.error,
connectionRefused: state.apierror.connectionRefused,
pathname: state.router.location.pathname,
location: state.router.location,
pathname: props.location.pathname,
versionId:
qs.parse(state.router.location.search) &&
qs.parse(state.router.location.search).version,
qs.parse(props.location.search) &&
qs.parse(props.location.search).version,
}),
{
listActions,
Expand Down
2 changes: 1 addition & 1 deletion src/server.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function setupServer(req, res, next) {
});

// Create a new Redux store instance
const [store] = configureStore(initialState, history, api);
const store = configureStore(initialState, history, api);

persistAuthToken(store, req);

Expand Down

0 comments on commit 720d402

Please sign in to comment.