mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Fix for supported device batch in NodeInfo
This commit is contained in:
parent
6dd250232c
commit
4f37f6a316
3 changed files with 22 additions and 33 deletions
|
|
@ -8119,6 +8119,7 @@
|
|||
}
|
||||
},
|
||||
"Community Support" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
|
|
@ -16011,6 +16012,7 @@
|
|||
}
|
||||
},
|
||||
"Full Support" : {
|
||||
"extractionState" : "stale",
|
||||
"localizations" : {
|
||||
"it" : {
|
||||
"stringUnit" : {
|
||||
|
|
|
|||
|
|
@ -34,9 +34,7 @@ struct SupportedHardwareBadge: View {
|
|||
}
|
||||
|
||||
var body: some View {
|
||||
switch hardware.count {
|
||||
case 1:
|
||||
let device = hardware[0]
|
||||
if let device = hardware.first {
|
||||
VStack {
|
||||
Image(systemName: device.activelySupported ? "checkmark.seal.fill" : "x.circle")
|
||||
.font(.largeTitle)
|
||||
|
|
@ -45,26 +43,23 @@ struct SupportedHardwareBadge: View {
|
|||
.foregroundStyle(.gray)
|
||||
.font(.caption2)
|
||||
}
|
||||
|
||||
default:
|
||||
if meshtasticAPI.isLoadingDeviceList {
|
||||
// Still loading the database from the API
|
||||
VStack {
|
||||
ProgressView()
|
||||
Text("Loading")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.caption2)
|
||||
}
|
||||
} else {
|
||||
// Can't find this hardware in the database
|
||||
VStack {
|
||||
Image(systemName: "questionmark.circle.fill")
|
||||
.font(.largeTitle)
|
||||
.foregroundStyle(.gray)
|
||||
Text("Unknown")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.caption2)
|
||||
}
|
||||
} else if meshtasticAPI.isLoadingDeviceList {
|
||||
// Still loading the database from the API
|
||||
VStack {
|
||||
ProgressView()
|
||||
Text("Loading")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.caption2)
|
||||
}
|
||||
} else {
|
||||
// Can't find this hardware in the database
|
||||
VStack {
|
||||
Image(systemName: "questionmark.circle.fill")
|
||||
.font(.largeTitle)
|
||||
.foregroundStyle(.gray)
|
||||
Text("Unknown")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.caption2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import MapKit
|
|||
struct NodeInfoItem: View {
|
||||
|
||||
@ObservedObject var node: NodeInfoEntity
|
||||
@State private var currentDevice: DeviceHardware?
|
||||
@EnvironmentObject var meshtasticAPI: MeshtasticAPI
|
||||
|
||||
var body: some View {
|
||||
|
|
@ -20,17 +19,10 @@ struct NodeInfoItem: View {
|
|||
ViewThatFits(in: .horizontal) {
|
||||
HStack {
|
||||
Spacer()
|
||||
if user.hwModel != "UNSET" {
|
||||
if let hwModelId = node.user?.hwModelId {
|
||||
VStack(alignment: .center) {
|
||||
Spacer()
|
||||
Image(systemName: currentDevice?.activelySupported ?? false ? "checkmark.seal.fill" : "seal.fill")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
.frame(width: 75, height: 75)
|
||||
.foregroundStyle(currentDevice?.activelySupported ?? false ? .green : .red)
|
||||
Text( currentDevice?.activelySupported ?? false ? "Full Support" : "Community Support")
|
||||
.foregroundStyle(.gray)
|
||||
.font(.callout)
|
||||
SupportedHardwareBadge(hwModelId: hwModelId)
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
Spacer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue