Store a product regulator's subjects in an array

This lets us iterate over subjects. Based on commit 257ce33, with a few
updates from 4a9e777.
This commit is contained in:
Aaron Fenyes 2025-03-26 23:50:40 -07:00
parent 7c40d60103
commit 00f60b0e90
3 changed files with 35 additions and 38 deletions

View file

@ -81,10 +81,10 @@ fn RegulatorOutlineItem(regulator_key: RegulatorKey, element_key: ElementKey) ->
let state = use_context::<AppState>();
let assembly = &state.assembly;
let regulator = assembly.regulators.with(|regs| regs[regulator_key]);
let other_subject = if regulator.subjects.0 == element_key {
regulator.subjects.1
let other_subject = if regulator.subjects[0] == element_key {
regulator.subjects[1]
} else {
regulator.subjects.0
regulator.subjects[0]
};
let other_subject_label = assembly.elements.with(|elts| elts[other_subject].label.clone());
view! {