Skip to content

Commit 2c3ad9a

Browse files
committed
feat: don't reload phases after adding
1 parent d877bc3 commit 2c3ad9a

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/projects/detail/containers/ProjectAddPhaseContainer.jsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { renderComponent, branch, compose, withProps } from 'recompose'
1414
import spinnerWhileLoading from '../../../components/LoadingSpinner'
1515
import { createProduct } from '../../actions/project'
1616
import { getProductTemplateByKey } from '../../../helpers/templates'
17-
import { loadProjectPhasesWithProducts } from '../../actions/project'
1817
import { loadProjectDashboard } from '../../../projects/actions/projectDashboard'
1918

2019

@@ -91,26 +90,17 @@ class ProjectAddPhaseContainer extends React.Component {
9190
window.location = returnUrl
9291
} else {
9392
if (isLoggedIn) {
94-
this.props.history.push(`/projects/${project.id}/plan`)
93+
this.props.history.push(`/projects/${project.id}`)
9594
} else {
9695
this.props.history.push('/')
97-
// FIXME ideally we should push on router
98-
// window.location = window.location.origin
9996
}
10097
}
10198
}
10299

103100
componentWillReceiveProps(props) {
104101
const project = _.get(props, 'project', null)
105102
if (!props.processing && !props.error && project && this.state.isChosenProduct) {
106-
if (this.state.shouldReloadPhases) {
107-
// reload the project
108-
props.loadProjectPhasesWithProducts(project.id)
109-
this.setState({shouldReloadPhases: false})
110-
} else if (!props.isLoadingPhases) {
111-
// back to plan
112-
this.closeWizard()
113-
}
103+
this.closeWizard()
114104
}
115105
}
116106

@@ -165,6 +155,6 @@ const mapStateToProps = ({projectState, loadUser, templates, productsTimelines }
165155
productCategories: templates.productCategories,
166156
})
167157

168-
const actionCreators = {createProduct, loadProjectPhasesWithProducts, loadProjectDashboard}
158+
const actionCreators = {createProduct, loadProjectDashboard}
169159

170160
export default withRouter(connect(mapStateToProps, actionCreators)(ProjectAddPhaseContainer))

0 commit comments

Comments
 (0)