@@ -61,7 +61,7 @@ class ProjectInfoContainer extends React.Component {
6161
6262 // load phases feeds if they are not loaded yet
6363 // note: old projects doesn't have phases, so we check if there are any phases at all first
64- phases && phases . forEach ( ( phase ) => {
64+ phases && phasesTopics && phases . forEach ( ( phase ) => {
6565 if ( ! phasesTopics [ phase . id ] ) {
6666 loadPhaseFeed ( project . id , phase . id )
6767 }
@@ -122,7 +122,7 @@ class ProjectInfoContainer extends React.Component {
122122 const { duration } = this . state
123123 const { project, currentMemberRole, isSuperUser, phases, feeds,
124124 hideInfo, hideLinks, hideMembers, onChannelClick, activeChannelId, productsTimelines,
125- isManageUser, phasesTopics } = this . props
125+ isManageUser, phasesTopics, isProjectPlan } = this . props
126126 let directLinks = null
127127 // check if direct links need to be added
128128 const isMemberOrCopilot = _ . indexOf ( [ PROJECT_ROLE_COPILOT , PROJECT_ROLE_MANAGER ] , currentMemberRole ) > - 1
@@ -191,7 +191,8 @@ class ProjectInfoContainer extends React.Component {
191191 title : `${ feed . title } ` ,
192192 address : feed . tag === PROJECT_FEED_TYPE_PRIMARY ? `/projects/${ project . id } #feed-${ feed . id } ` : `/projects/${ project . id } /plan#phase-${ feed . phaseId } -posts` ,
193193 noNewPage : true ,
194- onClick : feed . tag !== PROJECT_FEED_TYPE_PRIMARY && onChannelClick ? ( ) => onChannelClick ( feed ) : null ,
194+ //if PRIMARY discussion is to be loaded for project-plan page we won't attach the callback, for smoother transition to dashboard page
195+ onClick : ! ( isProjectPlan && feed . tag === PROJECT_FEED_TYPE_PRIMARY ) && onChannelClick ? ( ) => onChannelClick ( feed ) : null ,
195196 allowDefaultOnClick : true ,
196197 isActive : feed . id === activeChannelId ,
197198 } ) )
@@ -261,6 +262,7 @@ ProjectInfoContainer.PropTypes = {
261262 isSuperUser : PropTypes . bool ,
262263 isManageUser : PropTypes . bool ,
263264 productsTimelines : PropTypes . object . isRequired ,
265+ isProjectPlan : PropTypes . bool ,
264266}
265267
266268const mapDispatchToProps = { updateProject, deleteProject, addProjectAttachment, loadDashboardFeeds, loadPhaseFeed }
0 commit comments