diff --git a/Bundler.toml b/Bundler.toml index f8a1d93..9e8772e 100644 --- a/Bundler.toml +++ b/Bundler.toml @@ -4,7 +4,7 @@ format_version = 2 [apps.AmtrakStatus] identifier = 'com.tonybark.AmtrakStatus' product = 'AmtrakStatus' -version = '0.2.103' +version = '0.2.104' icon = "./assets/icon.png" category = "public.app-category.travel" diff --git a/Sources/AmtrakStatus/ContentView.swift b/Sources/AmtrakStatus/ContentView.swift index 1366751..d182232 100644 --- a/Sources/AmtrakStatus/ContentView.swift +++ b/Sources/AmtrakStatus/ContentView.swift @@ -14,7 +14,7 @@ struct ContentView: View { let amtrakDate = AmtrakDateFormatting() let unknown = "Unknown" - let staleDataThreshold: TimeInterval = 60 * 60 * 24 // 24 hours + let staleDataThreshold: TimeInterval = 60 * 60 * 48 // 48 hours var body: some View { VStack { @@ -94,6 +94,9 @@ struct ContentView: View { Task { await loadTrainStatus(forStationCode: normalizedStationCode) } + }.overlay(alignment: .topTrailing) { + Text("Information by Amtraker") + .padding(10) } } @@ -182,8 +185,7 @@ struct ContentView: View { let leg = train.stations?.first { $0.code == stationCode } guard - !isStale(leg, timeZone: timeZone) && - !isDataStale(train.trainID, staleness: staleness) + !isStale(leg, timeZone: timeZone), !isDataStale(train.trainID, staleness: staleness) else { return nil } @@ -209,8 +211,10 @@ struct ContentView: View { comparedTo: originZone ) - currentStation = stationName - localTimeZone = timeZone + if stationName != unknown { + currentStation = stationName + localTimeZone = timeZone + } return TrainStatusRow( trainID: train.trainID, diff --git a/changelog.md b/changelog.md index 91f9def..57f7f51 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Change Log +## 0.2.104 + +- Client now checks for any stale trains that are 48 hours old. +- Finally gave Amtraker credit. + ## 0.2.103 - A new column after number has "Enroute," "Station," and "Departed" status. It's left blank since status is already taken.