diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-01-21 00:11:41 -0500 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-01-21 00:11:41 -0500 |
| commit | 69e068d77731c25d9f1dbafb8c7d279e343a4e55 (patch) | |
| tree | 4df35c6233f9440d676e0b7e4758f113e4b10cfc /src/new_fields/util.ts | |
| parent | d528b9d19a685d8447a9d54715dc94cd66034852 (diff) | |
fixed up creating template fields in stacking views (+ after the template is made)
Diffstat (limited to 'src/new_fields/util.ts')
| -rw-r--r-- | src/new_fields/util.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/new_fields/util.ts b/src/new_fields/util.ts index 4147be278..3255c6172 100644 --- a/src/new_fields/util.ts +++ b/src/new_fields/util.ts @@ -1,7 +1,7 @@ import { UndoManager } from "../client/util/UndoManager"; import { Doc, Field, FieldResult, UpdatingFromServer } from "./Doc"; import { SerializationHelper } from "../client/util/SerializationHelper"; -import { ProxyField } from "./Proxy"; +import { ProxyField, PrefetchProxy } from "./Proxy"; import { RefField } from "./RefField"; import { ObjectField } from "./ObjectField"; import { action, trace } from "mobx"; @@ -52,7 +52,7 @@ const _setterImpl = action(function (target: any, prop: string | symbol | number value = new ProxyField(value); } if (value instanceof ObjectField) { - if (value[Parent] && value[Parent] !== receiver) { + if (value[Parent] && value[Parent] !== receiver && !(value instanceof PrefetchProxy)) { throw new Error("Can't put the same object in multiple documents at the same time"); } value[Parent] = receiver; |
