refactor: replace deprecated getPressureUnit and getTemperatureUnit functions with user model methods
Updated the GateDeviceInteraction and MeasurementDescriber components to utilize user.pressureUnit() instead of the deprecated getPressureUnit() function. Added deprecation comments in units.ts for clarity on the transition to User.tempUnit() and User.pressureUnit().
This commit is contained in:
parent
ccabbbbd17
commit
a2944d7a60
3 changed files with 10 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { pond } from "protobuf-ts/pond";
|
||||
|
||||
//function is deprecated, use User.tempUnit() instead
|
||||
export function getTemperatureUnit(): pond.TemperatureUnit {
|
||||
return localStorage.getItem("temperature") === "f"
|
||||
? pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT
|
||||
|
|
@ -31,6 +32,7 @@ export const fahrenheitToCelsius = (fahrenheit: number) => {
|
|||
return (fahrenheit - 32) * (5 / 9);
|
||||
};
|
||||
|
||||
// function is deprecated, use User.pressureUnit() instead
|
||||
export function getPressureUnit(): pond.PressureUnit {
|
||||
return localStorage.getItem("pressure") === "kpa"
|
||||
? pond.PressureUnit.PRESSURE_UNIT_KILOPASCALS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue