aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-14 18:19:20 -0400
committerbobzel <zzzman@gmail.com>2020-08-14 18:19:20 -0400
commitcd7b13c2c1086739d866e4a6ad9c239a46d89244 (patch)
treeed20d5a22d9ddb4a18fea2d679fee939fad8ab41
parent077a38dc22f6082974e639f8a020ceb179116958 (diff)
fix to give an author to template doc protos.
-rw-r--r--src/fields/Doc.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index b530b1cf7..5f5fe98bc 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -791,7 +791,9 @@ export namespace Doc {
let _applyCount: number = 0;
export function ApplyTemplate(templateDoc: Doc) {
if (templateDoc) {
- const target = Doc.MakeDelegate(new Doc());
+ const proto = new Doc();
+ proto.author = Doc.CurrentUserEmail;
+ const target = Doc.MakeDelegate(proto);
const targetKey = StrCast(templateDoc.layoutKey, "layout");
const applied = ApplyTemplateTo(templateDoc, target, targetKey, templateDoc.title + "(..." + _applyCount++ + ")");
target.layoutKey = targetKey;