From 926a0ddcf6528c1a1a9bfbff2b740d9f3040a9de Mon Sep 17 00:00:00 2001 From: bduran Date: Thu, 31 Oct 2024 10:12:49 -0700 Subject: [PATCH] fix constraint plan spec addition --- src/components/modals/ManagePlanConstraintsModal.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/modals/ManagePlanConstraintsModal.svelte b/src/components/modals/ManagePlanConstraintsModal.svelte index 6587e4fe15..376ce4244a 100644 --- a/src/components/modals/ManagePlanConstraintsModal.svelte +++ b/src/components/modals/ManagePlanConstraintsModal.svelte @@ -216,8 +216,11 @@ const constraintPlanSpec = $allowedConstraintPlanSpecMap[constraintId]; - if (isSelected && !constraintAlreadyExistsInPlanSpec) { - if (!constraintPlanSpec || constraintPlanSpec.constraint_metadata?.owner === user?.id) { + if (isSelected) { + if ( + !constraintAlreadyExistsInPlanSpec && + (!constraintPlanSpec || constraintPlanSpec.constraint_metadata?.owner === user?.id) + ) { return { ...prevConstraintPlanSpecUpdates, constraintPlanSpecsToAdd: [