diff options
author | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-15 00:42:50 -0700 |
---|---|---|
committer | Melissa Zhang <mzhang19096@gmail.com> | 2020-08-15 00:42:50 -0700 |
commit | 7652011ff230e1de8a698a1326ba2c621d9f482a (patch) | |
tree | e5e22f7c30834495bf2af06fe12d62b871b1cc4c /src/fields/Doc.ts | |
parent | bb2a9c80d1512d120d95dc1f603d1e3729dbb981 (diff) | |
parent | 49db347deac85eb3ea3c1e4297758cd6b18e0225 (diff) |
merge with master
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index ea53bc9a2..5f5fe98bc 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -781,6 +781,7 @@ export namespace Doc { if (doc) { const delegate = new Doc(id, true); delegate.proto = doc; + delegate.author = Doc.CurrentUserEmail; title && (delegate.title = title); return delegate; } @@ -790,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; |