Skip to content

Commit c045e69

Browse files
authored
Use locale distance set in altitude
1 parent 1743ef8 commit c045e69

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/clock_info/lib.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
let storage = require("Storage");
44
let stepGoal = undefined;
5+
let stepUpdateInterval;
56
// Load step goal from health app and pedometer widget
67
let d = storage.readJSON("health.json", true) || {};
78
stepGoal = d.stepGoal;
@@ -49,7 +50,8 @@ exports.load = function() {
4950
try {
5051
Bangle.getPressure().then(data=>{
5152
if (!data) return;
52-
alt = Math.round(data.altitude) + "m";
53+
54+
alt =require("locale").distance(data.altitude);
5355
bangleItems.find(i=>i.name=="Altitude").emit("redraw");
5456
});
5557
} catch (e) {
@@ -85,8 +87,9 @@ exports.load = function() {
8587
text : v, v : v, min : 0, max : stepGoal,
8688
img : atob("GBiBAAcAAA+AAA/AAA/AAB/AAB/gAA/g4A/h8A/j8A/D8A/D+AfH+AAH8AHn8APj8APj8AHj4AHg4AADAAAHwAAHwAAHgAAHgAADAA==")
8789
};},
88-
show : function() { Bangle.on("step", stepUpdateHandler); stepUpdateHandler(); },
89-
hide : function() { Bangle.removeListener("step", stepUpdateHandler); },
90+
show : function() { stepUpdateInterval=setInterval(stepUpdateHandler,150000); stepUpdateHandler(); },
91+
hide : function() { clearInterval(stepUpdateInterval); },
92+
run:stepUpdateHandler
9093
},
9194
{ name : "HRM",
9295
hasRange : true,

0 commit comments

Comments
 (0)