Skip to content

Commit

Permalink
Also make all the JS stuff async (nightscout#52)
Browse files Browse the repository at this point in the history
* make apsManager and openAPS async....highly wip

* cleanup

* clean up

* test

* cleanup

* small fixes for LA, refactoring

* refactoring of async functions

* cleanup

* async save function for Determination

* address PR feedback (better error handling)

* make JS worker functions async

* use async storage retrieve func in autosense()

* textfield

* fix deletion of keyboard tabbar 'Clear' button, replace buttons with appropiate SF symbols

* fix for bolus UI not updating

* fix for a wrong context use in ISF State

* fix decimal textfield toolbar

---------

Co-authored-by: Marvin Polscheit <marvinpolscheit@mac-mini.speedport.ip>
  • Loading branch information
polscm32 and Marvin Polscheit authored Jun 16, 2024
1 parent f18f79d commit 03df910
Show file tree
Hide file tree
Showing 20 changed files with 651 additions and 529 deletions.
45 changes: 45 additions & 0 deletions FreeAPS.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@
"version": null
}
},
{
"package": "swift-algorithms",
"repositoryURL": "https://github.com/apple/swift-algorithms",
"state": {
"branch": null,
"revision": "2327673b0e9c7e90e6b1826376526ec3627210e4",
"version": "0.2.1"
}
},
{
"package": "swift-numerics",
"repositoryURL": "https://github.com/apple/swift-numerics",
"state": {
"branch": null,
"revision": "6583ac70c326c3ee080c1d42d9ca3361dca816cd",
"version": "0.1.0"
}
},
{
"package": "SwiftCharts",
"repositoryURL": "https://github.com/ivanschuetz/SwiftCharts",
Expand All @@ -27,6 +45,33 @@
"revision": "c354c1945bb35a1f01b665b22474f6db28cba4a2",
"version": null
}
},
{
"package": "SwiftDate",
"repositoryURL": "https://github.com/malcommac/SwiftDate",
"state": {
"branch": null,
"revision": "6190d0cefff3013e77ed567e6b074f324e5c5bf5",
"version": "6.3.1"
}
},
{
"package": "SwiftMessages",
"repositoryURL": "https://github.com/SwiftKickMobile/SwiftMessages",
"state": {
"branch": null,
"revision": "62e12e138fc3eedf88c7553dd5d98712aa119f40",
"version": "9.0.9"
}
},
{
"package": "Swinject",
"repositoryURL": "https://github.com/Swinject/Swinject",
"state": {
"branch": null,
"revision": "3125943807991bc271d366205d98713696d65a1f",
"version": "2.8.8"
}
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion FreeAPS/Sources/APS/APSManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ final class BaseAPSManager: APSManager, Injectable {
}

func autosens() async throws -> Bool {
guard let autosens = storage.retrieve(OpenAPS.Settings.autosense, as: Autosens.self),
guard let autosens = await storage.retrieveAsync(OpenAPS.Settings.autosense, as: Autosens.self),
(autosens.timestamp ?? .distantPast).addingTimeInterval(30.minutes.timeInterval) > Date()
else {
let result = try await openAPS.autosense()
Expand Down
Loading

0 comments on commit 03df910

Please sign in to comment.