Skip to content

Conversation

@bharat
Copy link

@bharat bharat commented Dec 11, 2016

Pass the raw HKUnit.unitString (eg. mmol<180.1558800000541>/L) through
the context, as opposed to the unitDisplayString which is uses the
glucose-centric version (eg. mmol/L). This way we can properly hydrate
the unit on the extension side and represent it in the extension.

Fixes #311.

Pass the raw HKUnit.unitString (eg. mmol<180.1558800000541>/L) through
the context, as opposed to the unitDisplayString which is uses the
glucose-centric version (eg. mmol/L). This way we can properly hydrate
the unit on the extension side and represent it in the extension.

Fixes LoopKit#311.

if let glucose = latestGlucose,
preferredUnitDisplayString != nil {
preferredUnitString != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this check for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may not be necessary, but it's a safeguard against the possibility that we have glucose quantity and start date, but an improperly set preferred unit string. In that case, I'd rather send no glucose data than send it in the absence of a unit string. Happy to remove / adjust it if you see a better way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - reversing the order of the conditions would make that clearer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. reversed the order.

@ps2 ps2 merged commit 50214d4 into LoopKit:dev Dec 12, 2016
@bharat bharat deleted the issue_311 branch January 2, 2017 02:33
ps2 pushed a commit that referenced this pull request Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants