From 3e436b566ce0252a36cd6700e687dc9bc37f0376 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Mon, 29 Jan 2024 21:26:05 +0000 Subject: [PATCH] fix: "flashing" dest when long station name and no via point --- src/components/displays/NewGTR/TrainService.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/displays/NewGTR/TrainService.tsx b/src/components/displays/NewGTR/TrainService.tsx index 674d1e2..6ce2465 100644 --- a/src/components/displays/NewGTR/TrainService.tsx +++ b/src/components/displays/NewGTR/TrainService.tsx @@ -22,6 +22,8 @@ function getDestinationAsStrings(destination: IMyTrainService['destinations'][nu const name = `${andText}${destination.name}`; const via = destination.via || ''; + if (!via) return [name]; + const whole = `${name} ${via}`.trim(); if (whole.length <= DESTINATION_MAX_LENGTH) { @@ -40,7 +42,6 @@ export default function TrainService({ ordinal, service, showAdditionalDetails = ); const pages = getDestinationPages(); - const etd = service.displayedDepartureTime(); const isCancelled = service.cancelled;