Add options to choose type of bike, and also persist distance, power, calories, speed to db
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
</svg>
|
||||
|
||||
<div>
|
||||
{{ user.name }}
|
||||
{{ user.name }} - {{ user.bike.display_name }}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -324,8 +324,8 @@
|
||||
// Add the new data point to the data array
|
||||
data.push(newData);
|
||||
|
||||
let watts = generators.aab.rpm.power(rpm)
|
||||
let speed = generators.aab.rpm.speed(rpm)
|
||||
let watts = generators['{{ user.bike.code_name }}'].rpm.power(rpm)
|
||||
let speed = generators['{{ user.bike.code_name }}'].rpm.speed(rpm)
|
||||
if (previousReadingTime) {
|
||||
distance += calculateDistance(previousReadingTime, new Date(), speed)
|
||||
calories += calculateCalories(previousReadingTime, new Date(), watts)
|
||||
|
||||
Reference in New Issue
Block a user