From d7fe1aeb8585a83d5d7a57facab9db734537a672 Mon Sep 17 00:00:00 2001 From: Paul Plant <37302780+paulplant@users.noreply.github.com> Date: Thu, 30 May 2024 20:50:57 +0200 Subject: [PATCH 1/2] Remove "Siri" from the siri intent description - App Store Connect is complaining about it --- xdrip/GlucoseIntent.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdrip/GlucoseIntent.swift b/xdrip/GlucoseIntent.swift index f0a9960c6..08b07d035 100644 --- a/xdrip/GlucoseIntent.swift +++ b/xdrip/GlucoseIntent.swift @@ -20,7 +20,7 @@ struct GlucoseIntent: AppIntent { } static var description: IntentDescription? { - IntentDescription("Have Siri say your blood glucose level.", categoryName: "Information") + IntentDescription("Ask to read out your blood glucose level.", categoryName: "Information") } @MainActor From 2cdd7384da3f7cb13b230180dc9abbabd8b1ee26 Mon Sep 17 00:00:00 2001 From: Paul Plant <37302780+paulplant@users.noreply.github.com> Date: Thu, 30 May 2024 21:36:39 +0200 Subject: [PATCH 2/2] fix crash if contact image is enabled before any BG values are stored in coredata --- xdrip/Managers/ContactImage/ContactImageManager.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xdrip/Managers/ContactImage/ContactImageManager.swift b/xdrip/Managers/ContactImage/ContactImageManager.swift index d1d4e624b..d3779fcbe 100644 --- a/xdrip/Managers/ContactImage/ContactImageManager.swift +++ b/xdrip/Managers/ContactImage/ContactImageManager.swift @@ -100,10 +100,11 @@ class ContactImageManager: NSObject { // create a contact image view // get 2 last Readings, with a calculatedValue let lastReading = self.bgReadingsAccessor.get2LatestBgReadings(minimumTimeIntervalInMinutes: 4.0) - let valueIsUpToDate = abs(lastReading[0].timeStamp.timeIntervalSinceNow) < 7 * 60 var contactImageView: ContactImageView if lastReading.count > 0 { + let valueIsUpToDate = abs(lastReading[0].timeStamp.timeIntervalSinceNow) < 7 * 60 + contactImageView = ContactImageView(bgValue: lastReading[0].calculatedValue, isMgDl: UserDefaults.standard.bloodGlucoseUnitIsMgDl, slopeArrow: UserDefaults.standard.displayTrendInContactImage ? lastReading[0].slopeArrow() : "", bgRangeDescription: lastReading[0].bgRangeDescription(), valueIsUpToDate: valueIsUpToDate) // schedule an update in 5 min 15 seconds - if no new data is received until then, the empty value will get rendered into the contact (this update will be canceled if new data is received) @@ -115,7 +116,7 @@ class ContactImageManager: NSObject { DispatchQueue.main.asyncAfter(deadline: .now() + (5 * 60) + 15, execute: self.workItem!) } else { // create an 'empty' image view if there is no BG data to show - contactImageView = ContactImageView(bgValue: 0, isMgDl: UserDefaults.standard.bloodGlucoseUnitIsMgDl, slopeArrow: "", bgRangeDescription: .inRange, valueIsUpToDate: valueIsUpToDate) + contactImageView = ContactImageView(bgValue: 0, isMgDl: UserDefaults.standard.bloodGlucoseUnitIsMgDl, slopeArrow: "", bgRangeDescription: .inRange, valueIsUpToDate: false) } // we're going to use the app name as the given name of the contact we want to use/create/update