mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fixes for empty channel names and empty locale, potential crash on range test config view
This commit is contained in:
parent
af1c252637
commit
e2641143ca
3 changed files with 11 additions and 3 deletions
|
|
@ -46,7 +46,15 @@ struct Contacts: View {
|
|||
.padding(.trailing, 5)
|
||||
VStack {
|
||||
HStack {
|
||||
Text(String(channel.name ?? "Channel \(channel.index)").camelCaseToWords()).font(.headline)
|
||||
if channel.name?.isEmpty ?? false {
|
||||
if channel.role == 1 {
|
||||
Text(String("PrimaryChannel").camelCaseToWords()).font(.headline)
|
||||
} else {
|
||||
Text(String("Channel \(channel.index)").camelCaseToWords()).font(.headline)
|
||||
}
|
||||
} else {
|
||||
Text(String(channel.name ?? "Channel \(channel.index)").camelCaseToWords()).font(.headline)
|
||||
}
|
||||
Spacer()
|
||||
if channel.allPrivateMessages.count > 0 {
|
||||
VStack (alignment: .trailing) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct AboutMeshtastic: View {
|
|||
Link("GitHub Repository", destination: URL(string: "https://github.com/meshtastic/Meshtastic-Apple")!)
|
||||
.font(.title2)
|
||||
}
|
||||
if locale.region?.identifier == "US" {
|
||||
if locale.region?.identifier ?? "no locale" == "US" {
|
||||
Section(header: Text("Get Devices")) {
|
||||
Link("Buy Complete Radios", destination: URL(string: "https://www.etsy.com/shop/GarthVH")!)
|
||||
.font(.title2)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ struct RangeTestConfig: View {
|
|||
} label: {
|
||||
Label("Save", systemImage: "square.and.arrow.down")
|
||||
}
|
||||
.disabled(bleManager.connectedPeripheral == nil || !hasChanges || !(node!.myInfo?.hasWifi ?? false))
|
||||
.disabled(bleManager.connectedPeripheral == nil || !hasChanges || !(node?.myInfo?.hasWifi ?? false))
|
||||
.buttonStyle(.bordered)
|
||||
.buttonBorderShape(.capsule)
|
||||
.controlSize(.large)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue