mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
fix(ui): open globe picker when tapping Teleport with an empty geohash (#1866)
This commit is contained in:
1 parent
2691019689
commit
9720a14bd4
1 file changed
+8
-4
@@ -447,9 +447,14 @@ struct LocationChannelsSheet: View {
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityLabel(Strings.openMap)
|
||||
Button(action: {
|
||||
let gh = normalized
|
||||
if normalized.isEmpty {
|
||||
customError = nil
|
||||
showGlobePicker = true
|
||||
return
|
||||
}
|
||||
guard isValid else { customError = Strings.invalidGeohash; return }
|
||||
locationChannelsModel.teleport(to: gh)
|
||||
customError = nil
|
||||
locationChannelsModel.teleport(to: normalized)
|
||||
isPresented = false
|
||||
}) {
|
||||
HStack(spacing: 6) {
|
||||
@@ -465,8 +470,7 @@ struct LocationChannelsSheet: View {
|
||||
.padding(.horizontal, 10)
|
||||
.background(palette.secondary.opacity(0.12))
|
||||
.cornerRadius(6)
|
||||
.opacity(isValid ? 1.0 : 0.4)
|
||||
.disabled(!isValid)
|
||||
.opacity(isValid || normalized.isEmpty ? 1.0 : 0.6)
|
||||
}
|
||||
if let err = customError {
|
||||
Text(err)
|
||||
|
||||
Reference in new issue
Block a user