@@ -115,14 +115,14 @@ extension SiteDetailViewController {
115
115
switch ( result) {
116
116
case let . Error( error) :
117
117
// display error message
118
- print ( " error: \( error) " )
118
+ print ( " error: \( error) " )
119
119
self . navigationController? . popViewControllerAnimated ( true )
120
120
121
121
case let . Value( boxedConfiguration) :
122
122
let configuration : ServerConfiguration = boxedConfiguration. value
123
123
// Get back on the main queue to update the user interface
124
124
dispatch_async ( dispatch_get_main_queue ( ) , { ( ) -> Void in
125
-
125
+
126
126
self . updateTitles ( configuration. displayName)
127
127
128
128
if let enabledOptions = configuration. enabledOptions {
@@ -166,17 +166,23 @@ extension SiteDetailViewController {
166
166
self . siteLastReadingLabel? . text = watchEntry. dateTimeAgoString
167
167
self . siteLastReadingLabel? . textColor = self . defaultTextColor
168
168
169
- // Raw label
170
- if let rawValue = watchEntry. raw {
171
- let color = colorForDesiredColorState ( configuration. boundedColorForGlucoseValue ( rawValue) )
172
-
173
- var raw = " \( rawValue. formattedForMgdl) "
174
- if configuration. displayUnits == . Mmol {
175
- raw = rawValue. formattedForMmol
169
+
170
+ if configuration. displayRawData {
171
+ // Raw label
172
+ if let rawValue = watchEntry. raw {
173
+ let color = colorForDesiredColorState ( configuration. boundedColorForGlucoseValue ( rawValue) )
174
+
175
+ var raw = " \( rawValue. formattedForMgdl) "
176
+ if configuration. displayUnits == . Mmol {
177
+ raw = rawValue. formattedForMmol
178
+ }
179
+
180
+ self . siteRawLabel? . textColor = color
181
+ self . siteRawLabel? . text = " \( raw) : \( sgv. noise) "
176
182
}
177
-
178
- self . siteRawLabel ? . textColor = color
179
- self . siteRawLabel? . text = " \( raw ) : \( sgv . noise ) "
183
+ } else {
184
+ self . siteRawHeader ? . hidden = true
185
+ self . siteRawLabel? . hidden = true
180
186
}
181
187
182
188
let timeAgo = watchEntry. date. timeIntervalSinceNow
@@ -249,7 +255,7 @@ extension SiteDetailViewController {
249
255
AppDataManager . sharedInstance. shouldDisableIdleTimer = self . site!. overrideScreenLock
250
256
AppDataManager . sharedInstance. updateSite ( site!)
251
257
UIApplication . sharedApplication ( ) . idleTimerDisabled = site!. overrideScreenLock
252
-
258
+
253
259
#if DEBUG
254
260
print ( " {site.overrideScreenLock: \( site? . overrideScreenLock) , AppDataManager.shouldDisableIdleTimer: \( AppDataManager . sharedInstance. shouldDisableIdleTimer) , UIApplication.idleTimerDisabled: \( UIApplication . sharedApplication ( ) . idleTimerDisabled) } " )
255
261
#endif
@@ -281,7 +287,7 @@ extension SiteDetailViewController {
281
287
}
282
288
283
289
alertController. addAction ( yesAction)
284
-
290
+
285
291
if #available( iOS 9 . 0 , * ) {
286
292
alertController. preferredAction = yesAction
287
293
}
@@ -299,7 +305,7 @@ extension SiteDetailViewController {
299
305
#endif
300
306
}
301
307
alertController. addAction ( noAction)
302
-
308
+
303
309
alertController. view. tintColor = NSAssetKit . darkNavColor
304
310
305
311
self . view. window? . tintColor = nil
@@ -309,7 +315,7 @@ extension SiteDetailViewController {
309
315
if let popoverController = alertController. popoverPresentationController {
310
316
popoverController. barButtonItem = sender
311
317
}
312
-
318
+
313
319
self . presentViewController ( alertController, animated: true ) {
314
320
#if DEBUG
315
321
print ( " presentViewController: \( alertController. debugDescription) " )
0 commit comments