From e7caddce4302cd65cad19fc07519a61b1c17e11a Mon Sep 17 00:00:00 2001 From: EmmaLRussell Date: Tue, 19 Sep 2023 16:35:27 +0100 Subject: [PATCH] split up filtering logic --- app/static/src/app/components/options/SensitivityOptions.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/static/src/app/components/options/SensitivityOptions.vue b/app/static/src/app/components/options/SensitivityOptions.vue index c5203e78b..0a2ed206b 100644 --- a/app/static/src/app/components/options/SensitivityOptions.vue +++ b/app/static/src/app/components/options/SensitivityOptions.vue @@ -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; });