Skip to content

Commit

Permalink
Fixes journey next scheduled date reset (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
pushchris authored Sep 28, 2024
1 parent 3357de6 commit 2a8d03f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/platform/src/journey/JourneyRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,12 @@ export const setJourneyStepMap = async (journeyId: number, stepMap: JourneyStepM
steps.push(step = new JourneyStep())
}
let next_scheduled_at: null | Date = null
if (type === JourneyEntrance.type
&& data.trigger === 'schedule'
&& step.data?.schedule !== data.schedule) {
next_scheduled_at = JourneyEntrance.fromJson({ data }).nextDate(now)
if (type === JourneyEntrance.type && data.trigger === 'schedule') {
if (step.data?.schedule !== data.schedule) {
next_scheduled_at = JourneyEntrance.fromJson({ data }).nextDate(now)
} else {
next_scheduled_at = step.next_scheduled_at
}
}
const fields = { data, data_key, name, next_scheduled_at, x, y }
step.parseJson(step.id
Expand Down

0 comments on commit 2a8d03f

Please sign in to comment.