diff --git a/apps/mobile/metro-now/metro-now Watch App/ContentView.swift b/apps/mobile/metro-now/metro-now Watch App/ContentView.swift index 76384271..3de4c842 100644 --- a/apps/mobile/metro-now/metro-now Watch App/ContentView.swift +++ b/apps/mobile/metro-now/metro-now Watch App/ContentView.swift @@ -17,10 +17,12 @@ struct ContentView: View { let stops, let closestStop = findClosestStop(to: location, stops: stops) { + let platforms = closestStop.platforms.filter { $0.routes.count > 0 } + StopDeparturesView( title: closestStop.name, - platforms: closestStop.platforms.map { - platform in + platforms: platforms.map { platform in + MainPagePlatform( id: platform.id, metroLine: MetroLine(rawValue: platform.routes[0].name), diff --git a/apps/mobile/metro-now/metro-now.xcodeproj/project.pbxproj b/apps/mobile/metro-now/metro-now.xcodeproj/project.pbxproj index 9a9ab567..89d1ab67 100644 --- a/apps/mobile/metro-now/metro-now.xcodeproj/project.pbxproj +++ b/apps/mobile/metro-now/metro-now.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"metro-now Watch App/Preview Content\""; DEVELOPMENT_TEAM = R6WU5ABNG2; ENABLE_PREVIEWS = YES; @@ -382,7 +382,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.3; + MARKETING_VERSION = 0.2.1; PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now.watchkitapp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -400,7 +400,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"metro-now Watch App/Preview Content\""; DEVELOPMENT_TEAM = R6WU5ABNG2; ENABLE_PREVIEWS = YES; @@ -414,7 +414,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.3; + MARKETING_VERSION = 0.2.1; PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now.watchkitapp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; @@ -433,7 +433,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"metro-now/Preview Content\""; DEVELOPMENT_TEAM = R6WU5ABNG2; ENABLE_PREVIEWS = YES; @@ -451,7 +451,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.3; + MARKETING_VERSION = 0.2.1; PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -467,7 +467,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_ASSET_PATHS = "\"metro-now/Preview Content\""; DEVELOPMENT_TEAM = R6WU5ABNG2; ENABLE_PREVIEWS = YES; @@ -485,7 +485,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.3; + MARKETING_VERSION = 0.2.1; PRODUCT_BUNDLE_IDENTIFIER = "com.krystof.metro-now"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; diff --git a/apps/mobile/metro-now/metro-now/pages/closest-stop/closest-metro-stop-section.view.swift b/apps/mobile/metro-now/metro-now/pages/closest-stop/closest-metro-stop-section.view.swift index 00cc2efd..e4320416 100644 --- a/apps/mobile/metro-now/metro-now/pages/closest-stop/closest-metro-stop-section.view.swift +++ b/apps/mobile/metro-now/metro-now/pages/closest-stop/closest-metro-stop-section.view.swift @@ -9,27 +9,28 @@ struct ClosestMetroStopSectionView: View { var body: some View { ForEach(closestStop.platforms, id: \.id) { platform in - let routeLabel: String = platform.routes[0].name - let routeLabelBackground: Color = getColorByRouteName(routeLabel) - let platformDepartures: [ApiDeparture]? = departures?.filter { departure in - departure.platformId == platform.id - } + let platformDepartures: [ApiDeparture]? = departures?.filter { $0.platformId == platform.id } - if let platformDepartures, platformDepartures.count > 0 { + if platform.routes.count == 0 { + EmptyView() + } else if let platformDepartures, platformDepartures.count > 0 { + let routeLabel: String = platform.routes[0].name let nextDeparture = platformDepartures.count > 1 ? platformDepartures[1] : nil ClosestStopPageListItemView( routeLabel: routeLabel, - routeLabelBackground: routeLabelBackground, + routeLabelBackground: getColorByRouteName(routeLabel), headsign: platformDepartures[0].headsign, departure: platformDepartures[0].departure.predicted, nextHeadsign: nextDeparture?.headsign, nextDeparture: nextDeparture?.departure.scheduled ) } else { + let routeLabel: String = platform.routes[0].name + ClosestStopPageListItemPlaceholderView( routeLabel: routeLabel, - routeLabelBackground: routeLabelBackground + routeLabelBackground: getColorByRouteName(routeLabel) ) } }