aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-02-13 19:26:59 -0600
committerIván Ávalos <avalos@disroot.org>2022-02-13 19:26:59 -0600
commitfbe87f8e0091adcddd9ec195d0ae6d7829be3c3c (patch)
treea74d6ddf13ae1e2d0b7bb1776288018c0a5aa69d
parent754ffab4829ec20e71c0f753bb9c6fc5b42ca196 (diff)
downloadetbsa-trackermap-mobile-fbe87f8e0091adcddd9ec195d0ae6d7829be3c3c.tar.gz
etbsa-trackermap-mobile-fbe87f8e0091adcddd9ec195d0ae6d7829be3c3c.tar.bz2
etbsa-trackermap-mobile-fbe87f8e0091adcddd9ec195d0ae6d7829be3c3c.zip
Reverted change in commands view
-rw-r--r--iosApp/iosApp/Details/Commands/UnitCommandsView.swift10
1 files changed, 6 insertions, 4 deletions
diff --git a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
index b60b1cf..eef3ae4 100644
--- a/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
+++ b/iosApp/iosApp/Details/Commands/UnitCommandsView.swift
@@ -21,7 +21,12 @@ import shared
struct UnitCommandsView: View {
@ObservedObject var unitCommandsViewModel = UnitCommandsViewModel()
- let unit: UnitInformation
+ var unit: UnitInformation
+
+ init(unit: UnitInformation) {
+ self.unit = unit
+ unitCommandsViewModel.fetchCommands(id: unit.device.id)
+ }
var body: some View {
VStack {
@@ -49,8 +54,5 @@ struct UnitCommandsView: View {
}
}
}
- .onAppear {
- unitCommandsViewModel.fetchCommands(id: unit.device.id)
- }
}
}