From d55ddf9c4b198cb714ead5170a6d221ddb82bc37 Mon Sep 17 00:00:00 2001 From: Krystof Date: Tue, 21 May 2024 22:53:00 +0200 Subject: [PATCH] feat(app): pull to refresh --- app/metro-now/Core/PlatformList/PlatformListView.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/metro-now/Core/PlatformList/PlatformListView.swift b/app/metro-now/Core/PlatformList/PlatformListView.swift index 5e685e56..a1ba16de 100644 --- a/app/metro-now/Core/PlatformList/PlatformListView.swift +++ b/app/metro-now/Core/PlatformList/PlatformListView.swift @@ -50,6 +50,15 @@ struct PlatformsListView: View { return } + do { + departuresByGtfsID = try await viewModel.getData(gtfsIDs: station.properties.platforms.map(\.gtfsId)) + } catch {} + } + .refreshable { + guard let station else { + return + } + do { departuresByGtfsID = try await viewModel.getData(gtfsIDs: station.properties.platforms.map(\.gtfsId)) } catch {}