Use environment appName instead of hardcoded Loop#14
Conversation
|
|
||
| static func useMySentry(_ value: Bool) -> T { | ||
| let vc = T() | ||
| @Environment(\.appName) var appName |
There was a problem hiding this comment.
@Environment is generally used on a SwiftUI view (this is an extension on a UIKit View controller), as the data is passed through the view hierarchy. I'm not sure how/if this is working?
|
I prepared code to use appName based off a few hints. I am working via "prototype example" and don't have a solid understanding of how and why it works. Your comment above that "@Environment is generally used on a SwiftUI view (this is an extension on a UIKit View controller)" probably indicates this will not work for I was not able to test the modification for this file because I do not have a Medtronic pump that supports MySentry. I was able to test the other instances and show that they did work as expected. There was a case for OmniBLE/Kit (BeepPreference) where the attempt to use appName did not succeed. See this link: To summarize tests done in that PR: "To reiterate the problem, this picks up the defaultValue from LoopKit instead of the appName from the environment that I expected." In that case, I demonstrated that whatever value was found on this line in |
Parallel PR to LoopKit LoopKit#14, Enable app name instead of hardcoded Loop
|
I opened this PR a long time ago when I did not know very much.
I just merged PR #16 which has a change that is used by Trio but does not affect Loop. Decision - I'm closing this PR. Later on I will update the |
* async updates * Changes for protocol updates
* async updates * Changes for protocol updates
PumpOpsSession.swift)None of these changes could be tested.