From c06645c69efa94126706f4fa7bfb234f91c15cdd Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sun, 23 Jun 2024 01:55:30 +0200 Subject: [PATCH] fix: when mins == 0, disruption cannot be announced Closes #242 --- src/announcement-data/systems/stations/AmeyPhil.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/announcement-data/systems/stations/AmeyPhil.tsx b/src/announcement-data/systems/stations/AmeyPhil.tsx index 5938d328f..1bf7057e6 100644 --- a/src/announcement-data/systems/stations/AmeyPhil.tsx +++ b/src/announcement-data/systems/stations/AmeyPhil.tsx @@ -4751,9 +4751,14 @@ export default class AmeyPhil extends StationAnnouncementSystem { const mins = num % 60 if (hours > 0) { - files.push(getNumber(hours), hours === 1 ? 'm.hour' : 'm.hours', 'm.and') + files.push(getNumber(hours), hours === 1 ? 'm.hour' : 'm.hours') + } + if (hours > 0 && mins > 0) { + files.push('m.and') + } + if (mins > 0) { + files.push(getNumber(mins), `${endInflection}.${mins !== 1 ? 'minutes' : 'minute'}`) } - files.push(getNumber(mins), `${endInflection}.${mins !== 1 ? 'minutes' : 'minute'}`) if (Array.isArray(options.disruptionReason)) { files.push('m.due to', ...options.disruptionReason)