mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-10-10 02:16:12 -05:00
Update workflow-edit-dialog.component.ts
This commit is contained in:
@@ -780,15 +780,17 @@ export class WorkflowEditDialogComponent
|
||||
|
||||
canAddCondition(formGroup: FormGroup): boolean {
|
||||
const conditions = this.getConditionsFormArray(formGroup)
|
||||
const usedTypes = conditions.controls.map(
|
||||
(control) => control.get('type').value as TriggerConditionType
|
||||
const usedTypes = new Set(
|
||||
conditions.controls.map(
|
||||
(control) => control.get('type').value as TriggerConditionType
|
||||
)
|
||||
)
|
||||
|
||||
return this.conditionDefinitions.some((definition) => {
|
||||
if (definition.allowMultipleEntries) {
|
||||
return true
|
||||
}
|
||||
return !usedTypes.includes(definition.id)
|
||||
return !usedTypes.has(definition.id)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user