Skip to content

Commit

Permalink
Removing unnecessary reload of page when bonus points or points overr…
Browse files Browse the repository at this point in the history
…ide are updated.
  • Loading branch information
krulis-martin committed Jul 23, 2023
1 parent 31133fb commit 3367ec6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/containers/PointsContainer/PointsContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import PointsForm from '../../components/forms/PointsForm';

import { setPoints, fetchSolution } from '../../redux/modules/solutions';
import { setPoints } from '../../redux/modules/solutions';

const PointsContainer = ({ overriddenPoints = null, bonusPoints, setPoints, ...props }) => (
<PointsForm
Expand All @@ -26,9 +26,6 @@ PointsContainer.propTypes = {
export default connect(
(state, props) => ({}),
(dispatch, { submissionId }) => ({
setPoints: ({ overriddenPoints, bonusPoints }) =>
dispatch(setPoints(submissionId, overriddenPoints, bonusPoints)).then(() =>
dispatch(fetchSolution(submissionId))
),
setPoints: ({ overriddenPoints, bonusPoints }) => dispatch(setPoints(submissionId, overriddenPoints, bonusPoints)),
})
)(PointsContainer);

0 comments on commit 3367ec6

Please sign in to comment.