diff options
author | bobzel <zzzman@gmail.com> | 2023-06-13 22:14:29 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-06-13 22:14:29 -0400 |
commit | bf16eca7a84adfdf1c5970e7e4793568ee70325d (patch) | |
tree | 44cfd9c63860171c9d890193e7d17f9f6d655a59 /src/fields/util.ts | |
parent | 8feb55cb8a6dc851f55ff4d7e612896c1045b626 (diff) |
fixed updating cached docs when opening a backlinks collection. added some FieldInfo types and added 'enumeration' field display in schema view. fixed bug in schema view column sizing. updated a bunch of standard field names to be more consistent.
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 62f27c7d2..f365adf4b 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -16,7 +16,7 @@ import { PrefetchProxy, ProxyField } from './Proxy'; import { RefField } from './RefField'; import { RichTextField } from './RichTextField'; import { SchemaHeaderField } from './SchemaHeaderField'; -import { ComputedField } from './ScriptField'; +import { ComputedField, ScriptField } from './ScriptField'; import { ScriptCast, StrCast } from './Types'; function _readOnlySetter(): never { @@ -69,10 +69,12 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number if (writeToDoc) { if (value === undefined) { - delete target[FieldKeys][prop]; + target[FieldKeys] && delete target[FieldKeys][prop]; // Lists don't have a FieldKeys field delete target.__fieldTuples[prop]; } else { - target[FieldKeys][prop] = true; + // bcz: uncomment to see if server is being updated + // console.log(prop + ' = ' + value + '(' + curValue + ')'); + target[FieldKeys] && (target[FieldKeys][prop] = true); // Lists don't have a FieldKeys field target.__fieldTuples[prop] = value; } |