12-29-2017 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-29-2017 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi there, I wonder if someone can help me...
I am using following to determine user setting...
unit.distance === "metric" ? 1: 0;
then I am using following if conditions code...
If (unit.distance == 1) {
....
} else {
....
}
My default distance unit is set to miles, but if I change it to km. It does not work and distance is still showing in miles on the clock face, but on ionic today screen it shows km. Not sure what I am doing wrong. Any help is greatly appreciated. Thanks...
Answered! Go to the Best Answer.

Accepted Solutions
01-09-2018 16:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-09-2018 16:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Are you importing units from the User Settings API?
What does console log return for distance?
I notice your code says unit, not units?
import { units } from "user-settings";
console.log(units.distance);
01-09-2018 16:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-09-2018 16:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Are you importing units from the User Settings API?
What does console log return for distance?
I notice your code says unit, not units?
import { units } from "user-settings";
console.log(units.distance);
