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