aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Details
diff options
context:
space:
mode:
Diffstat (limited to 'iosApp/iosApp/Details')
-rw-r--r--iosApp/iosApp/Details/Commands/UnitCommandsView.swift10
-rw-r--r--iosApp/iosApp/Details/Information/UnitInformationView.swift4
2 files changed, 6 insertions, 8 deletions
diff --git a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
index eef3ae4..b60b1cf 100644
--- a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
+++ b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
@@ -21,12 +21,7 @@ import shared
struct UnitCommandsView: View {
@ObservedObject var unitCommandsViewModel = UnitCommandsViewModel()
- var unit: UnitInformation
-
- init(unit: UnitInformation) {
- self.unit = unit
- unitCommandsViewModel.fetchCommands(id: unit.device.id)
- }
+ let unit: UnitInformation
var body: some View {
VStack {
@@ -54,5 +49,8 @@ struct UnitCommandsView: View {
}
}
}
+ .onAppear {
+ unitCommandsViewModel.fetchCommands(id: unit.device.id)
+ }
}
}
diff --git a/iosApp/iosApp/Details/Information/UnitInformationView.swift b/iosApp/iosApp/Details/Information/UnitInformationView.swift
index f713ab4..4c0d722 100644
--- a/iosApp/iosApp/Details/Information/UnitInformationView.swift
+++ b/iosApp/iosApp/Details/Information/UnitInformationView.swift
@@ -93,11 +93,11 @@ struct UnitInformationView: View {
}
}
// MARK: - Protocol
- if let protocol_ = unit.position?.protocol {
+ if let `protocol` = unit.position?.protocol {
HStack {
Text("protocol")
Spacer()
- Text(protocol_).foregroundColor(.secondaryLabel)
+ Text(`protocol`).foregroundColor(.secondaryLabel)
}
}
}