diff options
author | Sophie Zhang <sophie_zhang@brown.edu> | 2023-03-06 16:33:39 -0500 |
---|---|---|
committer | Sophie Zhang <sophie_zhang@brown.edu> | 2023-03-06 16:33:39 -0500 |
commit | 3a6f179aedf8e148fe9828426b43aa31ca87bcb1 (patch) | |
tree | 9f49ba8d54bda361826c17cfe7f3cb0a37854ace /src/fields/util.ts | |
parent | c6425a0469727305f76d00e3f8c545e04aad61cc (diff) | |
parent | 4c2584baf8bae0cde714c832b0768d3c08864422 (diff) |
Merge branch 'master' into pres-trail-sophie
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index dc0b41276..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); } @@ -350,7 +353,7 @@ export function getter(target: any, prop: string | symbol, proxy: any): any { return target[prop]; case AclSym : return target[AclSym]; case $mobx: return target.__fields[prop]; - case LayoutSym: return target.__Layout__; + case LayoutSym: return target.__LAYOUT__; case HeightSym: case WidthSym: if (GetEffectiveAcl(target) === AclPrivate) return returnZero; default : if (typeof prop === 'symbol') return target[prop]; |