Set calories heading based on user preference

This commit is contained in:
xeals
2021-10-25 17:37:49 +11:00
parent c9ff0543e3
commit 15eec9d373
3 changed files with 18 additions and 4 deletions

View File

@@ -175,6 +175,14 @@ export function convertEnergyToCalories(amount) {
}
}
export function energyHeading() {
if (getUserPreference('use_kj')) {
return 'Energy'
} else {
return 'Calories'
}
}
/*
* Utility functions to use OpenAPIs generically
* */