diff --git a/mobile/mobile.xcodeproj/project.pbxproj b/mobile/mobile.xcodeproj/project.pbxproj index ccaa4e0..4ca1dd7 100644 --- a/mobile/mobile.xcodeproj/project.pbxproj +++ b/mobile/mobile.xcodeproj/project.pbxproj @@ -312,7 +312,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; PRODUCT_BUNDLE_IDENTIFIER = voynow.mobile; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -343,7 +343,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.2.0; + MARKETING_VERSION = 2.2.1; PRODUCT_BUNDLE_IDENTIFIER = voynow.mobile; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/mobile/mobile/TrainingWeek.swift b/mobile/mobile/TrainingWeek.swift index 6407b27..667b837 100644 --- a/mobile/mobile/TrainingWeek.swift +++ b/mobile/mobile/TrainingWeek.swift @@ -87,6 +87,11 @@ struct WeeklyProgressContent: View { let completedMileage: Double let totalMileage: Double + private var progressPercentage: Int { + guard totalMileage > 0 else { return 0 } + return Int((completedMileage / totalMileage) * 100) + } + private var weekRange: String { var calendar = Calendar.current calendar.firstWeekday = 2 // 2 represents Monday @@ -118,8 +123,7 @@ struct WeeklyProgressContent: View { } HStack { - let progress = completedMileage / totalMileage - Text("\(Int(progress * 100))%") + Text("\(progressPercentage)%") .font(.system(size: 40, weight: .bold)) .foregroundColor(ColorTheme.white) @@ -136,7 +140,7 @@ struct WeeklyProgressContent: View { } } - ProgressBar(progress: completedMileage / totalMileage) + ProgressBar(progress: totalMileage > 0 ? completedMileage / totalMileage : 0) .frame(height: 8) .animation(.easeOut(duration: 0.8), value: completedMileage) }