with changing unit preferences and such to use the user object and not local storage, the decriber needed to be updated as well and i missed that part, so now describeMeasurement takes in an optional user and uses its settings for the unit and such and when not passed in will use the defaults

This commit is contained in:
csawatzky 2026-04-01 10:42:16 -06:00
parent 9d41499c27
commit 52c8a02af3
18 changed files with 117 additions and 56 deletions

View file

@ -195,7 +195,9 @@ export default function InteractionSettings(props: Props) {
let value = describeMeasurement(
condition.measurementType,
or(initialComponent, Component.create()).settings.type,
or(initialComponent, Component.create()).settings.subtype
or(initialComponent, Component.create()).settings.subtype,
undefined,
user
).toDisplay(condition.value);
rawConditionValues.push(value.toString());
});
@ -425,7 +427,7 @@ export default function InteractionSettings(props: Props) {
mappedComponents.get(componentIDToString(interaction.settings.source)),
Component.create()
);
return describeMeasurement(measurementType, source.settings.type, source.settings.subtype);
return describeMeasurement(measurementType, source.settings.type, source.settings.subtype, undefined, user);
};
const describeSink = (): MeasurementDescriber => {
@ -433,7 +435,9 @@ export default function InteractionSettings(props: Props) {
return describeMeasurement(
Measurement.boolean,
or(sink, Component.create()).settings.type,
or(sink, Component.create()).settings.subtype
or(sink, Component.create()).settings.subtype,
undefined,
user
);
};
@ -861,7 +865,7 @@ export default function InteractionSettings(props: Props) {
const conditionGroup = (index: number) => {
if (index >= numConditions) return;
let measurementType = interaction.settings.conditions[index].measurementType;
let source = describeSource(measurementType);
let source = describeSource(measurementType, );
let isBoolean = isBooleanValue(index);
return (
<React.Fragment key={index}>