aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Doc.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r--src/fields/Doc.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 51dacd181..24c18c232 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -527,14 +527,14 @@ export namespace Doc {
}
export function MakeEmbedding(doc: Doc, id?: string) {
- const embedding = !GetT(doc, 'isDataDoc', 'boolean', true) && doc.proto ? Doc.MakeCopy(doc, undefined, id) : Doc.MakeDelegate(doc, id);
+ const embedding = (!GetT(doc, 'isDataDoc', 'boolean', true) && doc.proto) || doc.type === DocumentType.CONFIG ? Doc.MakeCopy(doc, undefined, id) : Doc.MakeDelegate(doc, id);
const layout = Doc.LayoutField(embedding);
if (layout instanceof Doc && layout !== embedding && layout === Doc.Layout(embedding)) {
Doc.SetLayout(embedding, Doc.MakeEmbedding(layout));
}
embedding.createdFrom = doc;
embedding.proto_embeddingId = Doc.GetProto(doc).proto_embeddingId = DocListCast(Doc.GetProto(doc).proto_embeddings).length - 1;
- embedding.title = ComputedField.MakeFunction(`renameEmbedding(this)`);
+ !Doc.GetT(embedding, 'title', 'string', true) && (embedding.title = ComputedField.MakeFunction(`renameEmbedding(this)`));
embedding.author = Doc.CurrentUserEmail;
Doc.AddDocToList(doc[DocData], 'proto_embeddings', embedding);