fix to allow calibration when overrideWebOOPCalibration is enabled

This commit is contained in:
Johan Degraeve 2020-07-13 23:02:27 +02:00
parent 8974f5aa46
commit d8d500a042
1 changed files with 4 additions and 3 deletions

View File

@ -16,7 +16,7 @@ final class RootViewController: UIViewController {
@IBAction func calibrateButtonAction(_ sender: UIButton) {
if let cgmTransmitter = self.bluetoothPeripheralManager?.getCGMTransmitter(), cgmTransmitter.isWebOOPEnabled() {
if let cgmTransmitter = self.bluetoothPeripheralManager?.getCGMTransmitter(), cgmTransmitter.isWebOOPEnabled(), !UserDefaults.standard.overrideWebOOPCalibration {
let alert = UIAlertController(title: Texts_Common.warning, message: Texts_HomeView.calibrationNotNecessary, actionHandler: nil)
@ -609,7 +609,7 @@ final class RootViewController: UIViewController {
// first check keyValueObserverTimeKeeper
switch keyPathEnum {
case UserDefaults.Key.isMaster, UserDefaults.Key.overrideWebOOPCalibration :
case UserDefaults.Key.isMaster, UserDefaults.Key.overrideWebOOPCalibration, UserDefaults.Key.multipleAppBadgeValueWith10, UserDefaults.Key.showReadingInAppBadge, UserDefaults.Key.bloodGlucoseUnitIsMgDl, UserDefaults.Key.overrideWebOOPCalibration :
// transmittertype change triggered by user, should not be done within 200 ms
if !keyValueObserverTimeKeeper.verifyKey(forKey: keyPathEnum.rawValue, withMinimumDelayMilliSeconds: 200) {
@ -634,6 +634,7 @@ final class RootViewController: UIViewController {
}
case UserDefaults.Key.multipleAppBadgeValueWith10, UserDefaults.Key.showReadingInAppBadge, UserDefaults.Key.bloodGlucoseUnitIsMgDl:
// this will trigger update of app badge, will also create notification, but as app is most likely in foreground, this won't show up
createBgReadingNotificationAndSetAppBadge()
@ -1471,7 +1472,7 @@ extension RootViewController:NightScoutFollowerDelegate {
// save in core data
coreDataManager.saveChanges()
// update notification
// update notification and app badge
createBgReadingNotificationAndSetAppBadge()
// update all text in first screen