diff --git a/packages/loot-core/src/shared/rules.ts b/packages/loot-core/src/shared/rules.ts index bac5f81151d..0d4d3323d66 100644 --- a/packages/loot-core/src/shared/rules.ts +++ b/packages/loot-core/src/shared/rules.ts @@ -91,13 +91,13 @@ export const FIELD_TYPES = new Map( export function isValidOp(field: keyof FieldValueTypes, op: RuleConditionOp) { const type = FIELD_TYPES.get(field); - if (!type) { - return false; - } + + if (!type) return false; + if (fieldInfo[field].disallowedOps?.has(op)) return false; + return ( - (TYPE_INFO[type].ops.includes(op) || - fieldInfo[field].internalOps?.has(op)) && - !fieldInfo[field].disallowedOps?.has(op) + TYPE_INFO[type].ops.includes(op) || + fieldInfo[field].internalOps?.has(op) ); }