Skip to content

Commit

Permalink
fix: Mapping between kilocalories and kilojoules (#68)
Browse files Browse the repository at this point in the history
Due to a bug (probably a typo), kilocalories were being mapped to kilojoules when converting from ReactHealthRecord to HealthConnectRecord.
  • Loading branch information
lomagno2003 authored Mar 3, 2024
1 parent d3c1933 commit 27768fc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ fun getEnergyFromJsMap(energyMap: ReadableMap?): Energy {

val value = energyMap.getDouble("value")
return when (energyMap.getString("unit")) {
"kilojoules" -> Energy.kilocalories(value)
"kilocalories" -> Energy.kilojoules(value)
"kilojoules" -> Energy.kilojoules(value)
"kilocalories" -> Energy.kilocalories(value)
"joules" -> Energy.joules(value)
"calories" -> Energy.calories(value)
else -> Energy.calories(value)
Expand Down

0 comments on commit 27768fc

Please sign in to comment.