Various fixes

This commit is contained in:
Ilya Laktyushin
2023-08-11 21:19:22 +02:00
parent 3fee94d82b
commit 9f2e9407ef
10 changed files with 173 additions and 95 deletions

View File

@@ -150,7 +150,7 @@ private enum LocationPickerEntry: Comparable, Identifiable {
case let .city(_, title, subtitle, _, _, _, coordinate, name, countryCode):
let icon: LocationActionListItemIcon
if let name {
icon = .venue(TelegramMediaMap(latitude: 0, longitude: 0, heading: nil, accuracyRadius: nil, geoPlace: nil, venue: MapVenue(title: name, address: "City", provider: nil, id: "city", type: "building/default"), liveBroadcastingTimeout: nil, liveProximityNotificationRadius: nil))
icon = .venue(TelegramMediaMap(latitude: 0, longitude: 0, heading: nil, accuracyRadius: nil, geoPlace: nil, venue: MapVenue(title: name, address: presentationData.strings.Location_TypeCity, provider: "city", id: countryCode, type: "building/default"), liveBroadcastingTimeout: nil, liveProximityNotificationRadius: nil))
} else {
icon = .location
}
@@ -583,20 +583,28 @@ final class LocationPickerControllerNode: ViewControllerTracingNode, CLLocationM
switch strongSelf.mode {
case .share:
if source == .story {
title = "Add This Location"
title = presentationData.strings.Location_AddThisLocation
} else {
title = presentationData.strings.Map_SendThisLocation
}
case .pick:
title = presentationData.strings.Map_SetThisLocation
}
entries.append(.location(presentationData.theme, title, address ?? presentationData.strings.Map_Locating, nil, nil, nil, coordinate, state.street, state.countryCode, true))
if source == .story {
if state.street != "" {
entries.append(.location(presentationData.theme, state.street ?? presentationData.strings.Map_Locating, state.isStreet ? presentationData.strings.Location_TypeStreet : presentationData.strings.Location_TypeLocation, nil, nil, nil, coordinate, state.street, nil, false))
} else if state.city != "" {
entries.append(.city(presentationData.theme, state.city ?? presentationData.strings.Map_Locating, presentationData.strings.Location_TypeCity, nil, nil, nil, coordinate, state.city, state.countryCode))
}
} else {
entries.append(.location(presentationData.theme, title, address ?? presentationData.strings.Map_Locating, nil, nil, nil, coordinate, state.street, nil, true))
}
case .selecting:
let title: String
switch strongSelf.mode {
case .share:
if source == .story {
title = "Add This Location"
title = presentationData.strings.Location_AddThisLocation
} else {
title = presentationData.strings.Map_SendThisLocation
}