Skip to content

Commit 705366e

Browse files
authored
Merge pull request #2444 from appirio-tech/hotfix/phase_update_bug_fix
hotfix/phase_update_bug_fix[Master]
2 parents 2a26eb9 + 4eaf34e commit 705366e

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
@@ -378,7 +378,8 @@ export function updatePhase(projectId, phaseId, updatedProps, phaseIndex) {
378378
const phaseStatusChanged = phase.status !== updatedProps.status
379379
const productId = phase.products[0].id
380380
const timeline = state.productsTimelines[productId] && state.productsTimelines[productId].timeline
381-
const startDateChanged =updatedProps.startDate && updatedProps.startDate.diff(timeline.startDate)
381+
const phaseStartDate = timeline ? timeline.startDate : phase.startDate
382+
const startDateChanged = updatedProps.startDate ? updatedProps.startDate.diff(phaseStartDate) : null
382383
const phaseActivated = phaseStatusChanged && updatedProps.status === PHASE_STATUS_ACTIVE
383384
if (phaseActivated) {
384385
updatedProps.startDate = moment().hours(0).minutes(0).seconds(0).milliseconds(0)

0 commit comments

Comments
 (0)