diff options
author | mehekj <mehek.jethani@gmail.com> | 2023-03-06 17:54:29 -0500 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2023-03-06 17:54:29 -0500 |
commit | 1d07b09c90861d002139a0232e5aa1c1eba5e114 (patch) | |
tree | b0cbe99896f393c47eeb680764eba632f4d9eded /src/fields/util.ts | |
parent | b55a757175051457c9260f80a1de937901f5cfff (diff) | |
parent | 4c2584baf8bae0cde714c832b0768d3c08864422 (diff) |
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 3a7484cfd..e517e7604 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -1,3 +1,4 @@ +import { forEach } from 'lodash'; import { $mobx, action, observable, runInAction, trace } from 'mobx'; import { computedFn } from 'mobx-utils'; import { DocServer } from '../client/DocServer'; @@ -334,8 +335,10 @@ export function setter(target: any, in_prop: string | symbol | number, value: an return true; } } - if (target.__fields[prop] instanceof ComputedField && target.__fields[prop].setterscript && value !== undefined && !(value instanceof ComputedField)) { - return ScriptCast(target.__fields[prop])?.setterscript?.run({ self: target[SelfProxy], this: target[SelfProxy], value }).success ? true : false; + if (target.__fields[prop] instanceof ComputedField) { + if (target.__fields[prop].setterscript && value !== undefined && !(value instanceof ComputedField)) { + return ScriptCast(target.__fields[prop])?.setterscript?.run({ self: target[SelfProxy], this: target[SelfProxy], value }).success ? true : false; + } } return _setter(target, prop, value, receiver); } |