diff options
author | bobzel <zzzman@gmail.com> | 2023-06-29 15:00:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-06-29 15:00:58 -0400 |
commit | 5b2aded7e1de81cacbf5e92bc08b7b87ccebe401 (patch) | |
tree | 749a44cdf56b3bb9f963c5e3580cec0c1ae4e539 /src | |
parent | c99238c8b1e027099b2cd3f4b31b4c0b06d488d0 (diff) |
from last
Diffstat (limited to 'src')
-rw-r--r-- | src/fields/util.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index e439768ee..0f164a709 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -34,9 +34,8 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number return true; } - if (value !== undefined) { - value = value[SelfProxy] || value; - } + value = value?.[SelfProxy] ?? value; // convert any Doc type values to Proxy's + const curValue = target.__fieldTuples[prop]; if (curValue === value || (curValue instanceof ProxyField && value instanceof RefField && curValue.fieldId === value[Id])) { // TODO This kind of checks correctly in the case that curValue is a ProxyField and value is a RefField, but technically |