diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-18 14:14:35 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-07-18 14:14:35 -0400 |
commit | 8854d3277541a67aef4187b5d3592bea5a7fcfa2 (patch) | |
tree | 4728e8a2ffca9ff950e5e6e69e13e6117bb4c621 /src/new_fields/Doc.ts | |
parent | 8e1224482ba18f68818a44d5f05304b4303fc577 (diff) |
Can edit computed fields in KVP
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 769c6aa73..59e61023f 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -10,14 +10,15 @@ import { RefField, FieldId } from "./RefField"; import { ToScriptString, SelfProxy, Parent, OnUpdate, Self, HandleUpdate, Update, Id } from "./FieldSymbols"; import { scriptingGlobal } from "../client/util/Scripting"; import { List } from "./List"; +import { ComputedField } from "./ScriptField"; export namespace Field { export function toKeyValueString(doc: Doc, key: string): string { const onDelegate = Object.keys(doc).includes(key); - let field = FieldValue(doc[key]); + let field = ComputedField.WithoutComputed(() => FieldValue(doc[key])); if (Field.IsField(field)) { - return (onDelegate ? "=" : "") + Field.toScriptString(field); + return (onDelegate ? "=" : "") + (field instanceof ComputedField ? `:=${field.script.originalScript}` : Field.toScriptString(field)); } return ""; } |