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

@ -1,4 +1,4 @@
import { Interaction, Component } from "models";
import { Interaction, Component, User } from "models";
import { pond } from "protobuf-ts/pond";
import { quack } from "protobuf-ts/quack";
import { or, notNull } from "utils/types";
@ -172,7 +172,8 @@ export const interactionResultText = (interaction: Interaction, sink?: Component
export const interactionConditionText = (
source: Component | undefined,
condition: pond.IInteractionCondition,
and: boolean
and: boolean,
user?: User
) => {
let comparison = "is exactly";
switch (condition.comparison) {
@ -189,7 +190,7 @@ export const interactionConditionText = (
if (!condition.measurementType) return "Unknown " + comparison + " " + condition.value;
let sourceType = source && source.settings.type;
let sourceSubtype = source && source.settings.subtype;
let measurement = describeMeasurement(condition.measurementType, sourceType, sourceSubtype);
let measurement = describeMeasurement(condition.measurementType, sourceType, sourceSubtype, undefined, user);
return (
(and ? "and " : "") +
measurement.label() +