Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Distance unit from miles to km does not update clockface

ANSWERED

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...

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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);

 

View best answer in original post

Best Answer
1 REPLY 1

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);

 

Best Answer