diff --git a/xdrip/Supporting Files/Info.plist b/xdrip/Supporting Files/Info.plist
index e27f34ba..7957d81d 100644
--- a/xdrip/Supporting Files/Info.plist
+++ b/xdrip/Supporting Files/Info.plist
@@ -19,7 +19,7 @@
CFBundleShortVersionString
$(MARKETING_VERSION)
CFBundleVersion
- 3122
+ 3125
LSRequiresIPhoneOS
NSAppTransportSecurity
diff --git a/xdrip/View Controllers/SettingsNavigationController/SettingsViewController/AlertsSettingsViewController/AlertSettingsViewController/AlertSettingsViewControllerData.swift b/xdrip/View Controllers/SettingsNavigationController/SettingsViewController/AlertsSettingsViewController/AlertSettingsViewController/AlertSettingsViewControllerData.swift
index f3204018..dc7ea22a 100644
--- a/xdrip/View Controllers/SettingsNavigationController/SettingsViewController/AlertsSettingsViewController/AlertSettingsViewController/AlertSettingsViewControllerData.swift
+++ b/xdrip/View Controllers/SettingsNavigationController/SettingsViewController/AlertsSettingsViewController/AlertSettingsViewController/AlertSettingsViewControllerData.swift
@@ -212,16 +212,20 @@ extension AlertSettingsViewControllerData {
if AlertSettingsViewControllerData.getAlertKind(alertKind: alertKind).valueNeedsConversionToMmol() && !UserDefaults.standard.bloodGlucoseUnitIsMgDl {
keyboardType = .decimalPad
}
- let alert = UIAlertController(title: AlertSettingsViewControllerData.getAlertKind(alertKind: alertKind).alertTitle(), message: Texts_Alerts.changeAlertValue + " (" + alertKindAsAlertKind.valueUnitText(transmitterType: UserDefaults.standard.transmitterType) + ")", keyboardType: keyboardType, text: Double(value).mgdlToMmolAndToString(mgdl: UserDefaults.standard.bloodGlucoseUnitIsMgDl), placeHolder: nil, actionTitle: nil, cancelTitle: nil, actionHandler: { (text:String) in
+ let alert = UIAlertController(title: AlertSettingsViewControllerData.getAlertKind(alertKind: alertKind).alertTitle(), message: Texts_Alerts.changeAlertValue + " (" + alertKindAsAlertKind.valueUnitText(transmitterType: UserDefaults.standard.transmitterType) + ")", keyboardType: keyboardType, text: Double(value).mgdlToMmolAndToString(mgdl: UserDefaults.standard.bloodGlucoseUnitIsMgDl || !AlertSettingsViewControllerData.getAlertKind(alertKind: self.alertKind).valueNeedsConversionToMmol()), placeHolder: nil, actionTitle: nil, cancelTitle: nil, actionHandler: { (text:String) in
+
if var asdouble = text.toDouble() {
- if !UserDefaults.standard.bloodGlucoseUnitIsMgDl {
+
+ if !UserDefaults.standard.bloodGlucoseUnitIsMgDl && AlertSettingsViewControllerData.getAlertKind(alertKind: self.alertKind).valueNeedsConversionToMmol() {
asdouble = asdouble.mmolToMgdl()
}
+
self.value = Int16(asdouble)
tableView.reloadRows(at: [IndexPath(row: Setting.value.rawValue, section: 0)], with: .none)
// checkIfPropertiesChanged
self.checkIfPropertiesChanged()
}
+
}, cancelHandler: nil)
// present the alert