Skip to content

Commit

Permalink
fix constraint plan spec addition
Browse files Browse the repository at this point in the history
  • Loading branch information
duranb committed Oct 31, 2024
1 parent 4b8c494 commit 926a0dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/modals/ManagePlanConstraintsModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down

0 comments on commit 926a0dd

Please sign in to comment.