Skip to content

Commit 93259ca

Browse files
author
vikasrohit
authored
Merge pull request #2443 from appirio-tech/hotfix/phase_update_bug_fix
Hotfix/phase update bug fix[DEV]
2 parents c61e082 + 4eaf34e commit 93259ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/projects/actions/project.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) {
382382
const phaseStatusChanged = phase.status !== updatedProps.status
383383
const productId = phase.products[0].id
384384
const timeline = state.productsTimelines[productId] && state.productsTimelines[productId].timeline
385-
const startDateChanged =updatedProps.startDate && updatedProps.startDate.diff(timeline.startDate)
385+
const phaseStartDate = timeline ? timeline.startDate : phase.startDate
386+
const startDateChanged = updatedProps.startDate ? updatedProps.startDate.diff(phaseStartDate) : null
386387
const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE
387388
if (phaseActivated) {
388389
updatedProps.startDate = moment().hours(0).minutes(0).seconds(0).milliseconds(0)

0 commit comments

Comments
 (0)