Skip to content

Commit

Permalink
split up filtering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Sep 19, 2023
1 parent 4601ecd commit e7caddc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/static/src/app/components/options/SensitivityOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ export default defineComponent({
// return all params which are either unused or are the param for the settings to edit
const editIdx = editSettingsIdx.value;
const editParam = editIdx !== null && (allSettings.value[editIdx]?.parameterToVary || null);
return allParamNames.filter((p) => paramsWithoutSettings.value.includes(p)
|| (!addingParamSettings.value && editParam !== null && p === editParam));
// check if a given param is that for the settings being edited
const isEditParam = (p: string) => !addingParamSettings.value && editParam !== null && p === editParam;
return allParamNames.filter((p) => paramsWithoutSettings.value.includes(p) || isEditParam(p));
}
return allParamNames;
});
Expand Down

0 comments on commit e7caddc

Please sign in to comment.