Skip to content

Commit 0d5851e

Browse files
committed
Merge branch 'main' of github.com:cuappdev/uplift-ios-swiftui
2 parents e0a6611 + ad7eed1 commit 0d5851e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Uplift/Views/Home/HomeGymCell.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,17 @@ struct HomeGymCell: View {
188188
}
189189
}
190190

191+
@ViewBuilder
191192
private var distanceText: some View {
192-
Text("\(locationManager.distanceToCoordinates(latitude: gym.latitude, longitude: gym.longitude)) mi")
193-
.font(Constants.Fonts.labelMedium)
194-
.foregroundStyle(Constants.Colors.gray03)
193+
if locationManager.userLocation != nil {
194+
Text("\(locationManager.distanceToCoordinates(latitude: gym.latitude, longitude: gym.longitude)) mi")
195+
.font(Constants.Fonts.labelMedium)
196+
.foregroundStyle(Constants.Colors.gray03)
197+
} else {
198+
Text("")
199+
.font(Constants.Fonts.labelMedium)
200+
.foregroundStyle(Constants.Colors.gray03)
201+
}
195202
}
196203

197204
}

0 commit comments

Comments
 (0)