|
@@ -90,19 +90,34 @@ extension PluginSource: CGMManagerDelegate {
|
|
|
glucoseManager?.trioAlertManager?.retractAlert(identifier: identifier)
|
|
glucoseManager?.trioAlertManager?.retractAlert(identifier: identifier)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- func doesIssuedAlertExist(identifier _: LoopKit.Alert.Identifier, completion _: @escaping (Result<Bool, Error>) -> Void) {}
|
|
|
|
|
|
|
+ /// LoopKit asks this on reconnect to avoid re-issuing an alert that's
|
|
|
|
|
+ /// still live. `TrioAlertManager` deduplicates downstream via its own
|
|
|
|
|
+ /// throttler and live-alert table, so answering "no" here is safe — at
|
|
|
|
|
+ /// worst we get one duplicate banner, which the throttler suppresses.
|
|
|
|
|
+ func doesIssuedAlertExist(identifier _: LoopKit.Alert.Identifier, completion: @escaping (Result<Bool, Error>) -> Void) {
|
|
|
|
|
+ completion(.success(false))
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
func lookupAllUnretracted(
|
|
func lookupAllUnretracted(
|
|
|
managerIdentifier _: String,
|
|
managerIdentifier _: String,
|
|
|
- completion _: @escaping (Result<[LoopKit.PersistedAlert], Error>) -> Void
|
|
|
|
|
- ) {}
|
|
|
|
|
|
|
+ completion: @escaping (Result<[LoopKit.PersistedAlert], Error>) -> Void
|
|
|
|
|
+ ) {
|
|
|
|
|
+ completion(.success([]))
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
func lookupAllUnacknowledgedUnretracted(
|
|
func lookupAllUnacknowledgedUnretracted(
|
|
|
managerIdentifier _: String,
|
|
managerIdentifier _: String,
|
|
|
- completion _: @escaping (Result<[LoopKit.PersistedAlert], Error>) -> Void
|
|
|
|
|
- ) {}
|
|
|
|
|
|
|
+ completion: @escaping (Result<[LoopKit.PersistedAlert], Error>) -> Void
|
|
|
|
|
+ ) {
|
|
|
|
|
+ completion(.success([]))
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- func recordRetractedAlert(_: LoopKit.Alert, at _: Date) {}
|
|
|
|
|
|
|
+ /// LoopKit calls this when a manager itself decides an alert is no
|
|
|
|
|
+ /// longer relevant. Mirror the action on our pipeline so the in-app
|
|
|
|
|
+ /// banner, scheduled UN, and history all clear.
|
|
|
|
|
+ func recordRetractedAlert(_ alert: LoopKit.Alert, at _: Date) {
|
|
|
|
|
+ glucoseManager?.trioAlertManager?.retractAlert(identifier: alert.identifier)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
func cgmManagerWantsDeletion(_ manager: CGMManager) {
|
|
func cgmManagerWantsDeletion(_ manager: CGMManager) {
|
|
|
processQueue.async { [weak self] in
|
|
processQueue.async { [weak self] in
|