From 49ca8e97a9859c358c869ec7a598e97ed1039e28 Mon Sep 17 00:00:00 2001 From: Uskompuf <22492406+Uskompuf@users.noreply.github.com> Date: Mon, 13 Dec 2021 20:45:43 +1100 Subject: [PATCH] fix some predictions not deleting --- js/tracker.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/tracker.js b/js/tracker.js index 772ea0d..50c9b0d 100644 --- a/js/tracker.js +++ b/js/tracker.js @@ -770,8 +770,10 @@ function launchSitePredictions(times, station, properties, marker) { } if (count < maxCount) { if (((date - now) / 36e5) < 170) { - dates.push(date.toISOString().split('.')[0]+"Z"); - count += 1; + if (!dates.includes(date.toISOString().split('.')[0]+"Z")) { + dates.push(date.toISOString().split('.')[0]+"Z"); + count += 1; + } } } }