aboutsummaryrefslogtreecommitdiff
path: root/iosApp/iosApp/Devices/DeviceRow.swift
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-31 23:41:31 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-31 23:41:31 -0600
commit3d926c76f41f9fb40a4a17322d53eb2fd3383b69 (patch)
tree7b7ca05e7a4dbb5d5b24b48b37da6b5d0db44ca3 /iosApp/iosApp/Devices/DeviceRow.swift
parent90a9f7028053b3c4a56b88fcc52de675db5b9ab9 (diff)
downloadetbsa-trackermap-mobile-3d926c76f41f9fb40a4a17322d53eb2fd3383b69.tar.gz
etbsa-trackermap-mobile-3d926c76f41f9fb40a4a17322d53eb2fd3383b69.tar.bz2
etbsa-trackermap-mobile-3d926c76f41f9fb40a4a17322d53eb2fd3383b69.zip
- Adapter iOS app to changes in UnitsController
- Added getHourmeter() method to UnitInformation - Added missing license headers
Diffstat (limited to 'iosApp/iosApp/Devices/DeviceRow.swift')
-rw-r--r--iosApp/iosApp/Devices/DeviceRow.swift16
1 files changed, 7 insertions, 9 deletions
diff --git a/iosApp/iosApp/Devices/DeviceRow.swift b/iosApp/iosApp/Devices/DeviceRow.swift
index 9873c8e..e7966d2 100644
--- a/iosApp/iosApp/Devices/DeviceRow.swift
+++ b/iosApp/iosApp/Devices/DeviceRow.swift
@@ -104,15 +104,13 @@ struct DeviceRow: View {
}
/* Hourmeter */
- if let hourmeter = unit.position?.attributes["hours"] {
- if let hourmeter = Serialization.companion.longOrNull(json: hourmeter) {
- HStack {
- Label(Formatter.companion.formatHours(
- millis: Int64(truncating: hourmeter)),
- systemImage: "timer")
- .labelStyle(SmallLabelStyle())
- Spacer()
- }
+ if let hourmeter = unit.getHourmeter() {
+ HStack {
+ Label(Formatter.companion.formatHours(
+ millis: Int64(truncating: hourmeter)),
+ systemImage: "timer")
+ .labelStyle(SmallLabelStyle())
+ Spacer()
}
}