diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-02-12 17:37:20 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-02-12 17:37:20 -0600 |
commit | e58ceb3d9f7d4a0d497d5957d3fc21cef9ca554b (patch) | |
tree | 83971af6ebf12d930b95803c3ceb77199fcfedf5 /iosApp/iosApp/Details/Commands/UnitCommandsView.swift | |
parent | 8098ae108e59d3170f88379d8aa51363036ea5eb (diff) | |
download | etbsa-trackermap-mobile-e58ceb3d9f7d4a0d497d5957d3fc21cef9ca554b.tar.gz etbsa-trackermap-mobile-e58ceb3d9f7d4a0d497d5957d3fc21cef9ca554b.tar.bz2 etbsa-trackermap-mobile-e58ceb3d9f7d4a0d497d5957d3fc21cef9ca554b.zip |
Minor changes that doesn't have a major impact
Diffstat (limited to 'iosApp/iosApp/Details/Commands/UnitCommandsView.swift')
-rw-r--r-- | iosApp/iosApp/Details/Commands/UnitCommandsView.swift | 10 |
1 files changed, 4 insertions, 6 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) + } } } |