aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-05-13 16:21:28 -0400
committerbob <bcz@cs.brown.edu>2019-05-13 16:21:28 -0400
commit3be42131bc08024f06e0daec8d09e45bf3f1ddab (patch)
tree4ed0606fb7439f1b6c9f70b128f9e89f80ad5f4c /src/new_fields/Doc.ts
parent48b0f98ea2519d861a0eecee541dc0986a2c2f12 (diff)
a bunch of fixes to schemas, marquees, and an experimental feature to set a document's data with linking UI
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index a8c9d28e1..4c837fcbd 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -173,11 +173,15 @@ export namespace Doc {
export function MakeAlias(doc: Doc) {
const alias = new Doc;
- PromiseValue(Cast(doc.proto, Doc)).then(proto => {
- if (proto) {
- alias.proto = proto;
- }
- });
+ if (!doc.proto) {
+ alias.proto = doc;
+ } else {
+ PromiseValue(Cast(doc.proto, Doc)).then(proto => {
+ if (proto) {
+ alias.proto = proto;
+ }
+ });
+ }
return alias;
}