Keep disabled modifiers when making formulas
Some checks failed
Run Tests / test (pull_request) Has been cancelled
Some checks failed
Run Tests / test (pull_request) Has been cancelled
This commit is contained in:
parent
4f807aaf96
commit
cf6265d8ce
1 changed files with 2 additions and 2 deletions
|
@ -297,9 +297,9 @@ export function createSequentialModifier<
|
|||
getFormula: modifiers.every(m => m.getFormula != null)
|
||||
? (gain: FormulaSource) =>
|
||||
modifiers
|
||||
.filter(m => unref(m.enabled) !== false)
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
.reduce((acc, curr) => curr.getFormula!(acc), gain)
|
||||
.reduce((acc, curr) => Formula.if(acc, curr.enabled ?? true,
|
||||
acc => curr.getFormula!(acc), acc => acc), gain)
|
||||
: undefined,
|
||||
enabled: modifiers.some(m => m.enabled != null)
|
||||
? computed(() => modifiers.filter(m => unref(m.enabled) !== false).length > 0)
|
||||
|
|
Loading…
Reference in a new issue