diff --git a/src/announcement-data/systems/stations/AmeyPhil.tsx b/src/announcement-data/systems/stations/AmeyPhil.tsx index 5dbdd3114..8d3d04874 100644 --- a/src/announcement-data/systems/stations/AmeyPhil.tsx +++ b/src/announcement-data/systems/stations/AmeyPhil.tsx @@ -4196,8 +4196,11 @@ export default class AmeyPhil extends StationAnnouncementSystem { const restartAsTrainAfterIndex = callingPoints.findIndex(p => p.continuesAsTrainAfterHere) const upToRrb = callingPoints.slice(0, rrbAfterIndex + 1) - const rrbCalls = callingPoints.slice(rrbAfterIndex + 1, restartAsTrainAfterIndex === -1 ? Number.MAX_SAFE_INTEGER : restartAsTrainAfterIndex) - const restartedTrainCalls = restartAsTrainAfterIndex === -1 ? [] : callingPoints.slice(restartAsTrainAfterIndex) + const rrbCalls = callingPoints.slice( + rrbAfterIndex + 1, + restartAsTrainAfterIndex === -1 ? Number.MAX_SAFE_INTEGER : restartAsTrainAfterIndex + 1, + ) + const restartedTrainCalls = restartAsTrainAfterIndex === -1 ? [] : callingPoints.slice(restartAsTrainAfterIndex + 1) if (upToRrb.length >= 1) { files.push({ id: 'm.calling at', opts: { delayStart: this.callingPointsOptions.beforeCallingAtDelay } }) diff --git a/src/components/CallingAtSelector.tsx b/src/components/CallingAtSelector.tsx index 574c2ac6f..345309678 100644 --- a/src/components/CallingAtSelector.tsx +++ b/src/components/CallingAtSelector.tsx @@ -223,6 +223,26 @@ function CallingAtSelector({ }, )} + {enableRrbContinuations && + createOptionField( + { + default: false, + name: 'RRB ends; train restarts', + type: 'boolean', + // This can only happen once + disabled: + !value.some((s, _i) => s.continuesAsRrbAfterHere && i > _i) || + value.some(s => s.continuesAsTrainAfterHere && s.randomId !== stop.randomId), + }, + { + value: stop.continuesAsTrainAfterHere || false, + key: 'continuesAsTrainAfterHere', + onChange(v) { + onChange(value.map(s => (s.randomId === stop.randomId ? { ...s, continuesAsTrainAfterHere: v } : s))) + }, + }, + )} + {enableSplits && ( <> {createOptionField(