Commit 2ac6ed4c authored by Ray Schamp's avatar Ray Schamp

Use a prop for refreshSession

Since dispatch is not passed in anymore.
parent 99c1f3f0
...@@ -129,7 +129,7 @@ class Splash extends React.Component { ...@@ -129,7 +129,7 @@ class Splash extends React.Component {
useCsrf: true, useCsrf: true,
json: {cue: cue, value: false} json: {cue: cue, value: false}
}, err => { }, err => {
if (!err) this.props.dispatch(sessionActions.refreshSession()); if (!err) this.props.refreshSession();
}); });
} }
shouldShowWelcome () { shouldShowWelcome () {
...@@ -178,7 +178,6 @@ class Splash extends React.Component { ...@@ -178,7 +178,6 @@ class Splash extends React.Component {
Splash.propTypes = { Splash.propTypes = {
activity: PropTypes.arrayOf(PropTypes.object).isRequired, activity: PropTypes.arrayOf(PropTypes.object).isRequired,
dispatch: PropTypes.func,
featured: PropTypes.shape({ featured: PropTypes.shape({
community_featured_projects: PropTypes.array, community_featured_projects: PropTypes.array,
community_featured_studios: PropTypes.array, community_featured_studios: PropTypes.array,
...@@ -204,6 +203,7 @@ Splash.propTypes = { ...@@ -204,6 +203,7 @@ Splash.propTypes = {
isAdmin: PropTypes.bool, isAdmin: PropTypes.bool,
isEducator: PropTypes.bool, isEducator: PropTypes.bool,
loved: PropTypes.arrayOf(PropTypes.object).isRequired, loved: PropTypes.arrayOf(PropTypes.object).isRequired,
refreshSession: PropTypes.func.isRequired,
sessionStatus: PropTypes.string, sessionStatus: PropTypes.string,
setRows: PropTypes.func.isRequired, setRows: PropTypes.func.isRequired,
shared: PropTypes.arrayOf(PropTypes.object).isRequired, shared: PropTypes.arrayOf(PropTypes.object).isRequired,
...@@ -257,6 +257,9 @@ const mapDispatchToProps = dispatch => ({ ...@@ -257,6 +257,9 @@ const mapDispatchToProps = dispatch => ({
getLovedByFollowing: (username, token) => { getLovedByFollowing: (username, token) => {
dispatch(splashActions.getLovedByFollowing(username, token)); dispatch(splashActions.getLovedByFollowing(username, token));
}, },
refreshSession: () => {
dispatch(sessionActions.refreshSession());
},
setRows: (type, rows) => { setRows: (type, rows) => {
dispatch(splashActions.setRows(type, rows)); dispatch(splashActions.setRows(type, rows));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment