diff options
-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 |